Password Library and Creating a Variable Integer

You missed the last part of the first code block in reply#33 where mode is defined.

And you don't have to add an eventListener; plenty code has been written that does not use it.