Check for input in windows

I found in selectable windows you can do:

if (Input.isTriggered("ok")) { // Custom jazz here ... }I make great use of this in Currencies and In Laws script. But what I find is you cannot do:

if (Input.isTriggered("cancel")) { // Custom jazz here ... }because if you have this called in the scene's update that takes precedent over the windows update method and thus the command is never triggered.

So....

I currently have it so that in a single scene you have two selectable windows, one allows you to select items, you hit enter, the other becomes active allowing you to select items. But if you hit cancel (or esc) then instead of going back to the first window and making that window active, the scene is closed.

So my question is:

How do I make the window's input take precedent over the scenes update when a user hits esc or cancel?
You add a check in the scene's update function to check which window is active. If the secondary window is active and escape is triggered, don't make the scene's update function do anything. just ignore it. Just be sure to check in the second window for escape so you can properly call a handler that will return to the first window.
makes sense. If you dont have a Input.isTriggered in the scene then does it know to use the windows?
If you don't check in the scene, you'll have to make sure that the one of the windows has a handler for cancel, and that the handler has a way to exit the scene.

Original thread: https://forums.rpgmakerweb.com/threads/check-for-input-in-windows.51608/