Custom menu system

I've been researching Javascript so that i can use it to customize my game to a much greater degree. I wanted to start by creating my own working menu system however, when i try to use the isPressed method located in rpg  maker mv's input class, it doesn't work. Does anybody know how to fix this?.
IsPressed responds to key presses.


For example 


Input.isPressed ("ok")


Would return true when ok is pressed, which is usually the z key.


By itself it's useless; you'd have to put it in some sort of scene or window update to check if ok, cancel, etc is pressed.
Can you explain what do you mean by "put it in a scene or a window"?.

Original thread: https://forums.rpgmakerweb.com/threads/custom-menu-system.62440/