how to check if a button is released?

Title, Im trying to make something happen when the right key is let go, how would i go about that?
Are you using any plugins to extend what buttons RM will recognize as having been pressed? Otherwise, the only keys you can use are “up”, “down”, “left”, “right”, “menu”, “cancel”, “escape”, “ok”, “pageup”, “pagedown”, “shift”, “control”, “tab”, and “debug”.

As long as you’re not using one of those, though, I do have a solution that doesn’t require any plugins. Make a common event with a trigger of “parallel” and a switch that’s set earlier in the event. Use the following in said common event:

Code:
◆Comment:ParallelSwitch and the switch ID 10 are NOT the same switch.
◆Script:if (Input.isPressed('menu')) {$gameSwitches.setValue(10,true)};
◆If:ParallelSwitch is ON
  ◆Script:if (Input.isPressed('menu')) {$gameSwitches.setValue(10,true)} else {$gameSwitches.setValue(10,false)};
  ◆If:ParallelSwitch is OFF
    ◆ {INSERT STUFF YOU WANT TO DO HERE}
    ◆
  :End
  ◆
:End

You can replace “menu” and “10” with the appropriate button and switch ID. Also, make sure you remember to turn off the switch that enabled the parallel common event somewhere in the {INSERT STUFF YOU WANT TO DO HERE} section, preferably as the very first thing in that section, to keep the parallel from running again.
Just to mention it: Conditional Branch -> Button can be used to check states of the default inputs, so you don't need any scripting for those.
Spoiler: event example
◆Comment:Initialise switch. ◆Control Switches:#0020 ButtonDown = OFF ◆Comment:Give player instructions! ◆Text:None, Window, Bottom : :After this message: : :press, hold, then release the shift button. ◆Comment:Check each frame for input. ◆Loop ◆Comment:Check if button is pressed. ◆If:Button [Shift] is pressed down ◆If:ButtonDown is OFF ◆Text:None, Window, Bottom : :Shift pressed! ◆Control Switches:#0020 ButtonDown = ON ◆ :End ◆ :Else ◆If:ButtonDown is ON ◆Break Loop ◆ :End ◆ :End ◆Comment:Check again next frame. ◆Wait:1 frame ◆ :Repeat Above ◆Text:None, Window, Bottom : :Shift released! ◆Control Switches:#0020 ButtonDown = OFF
If your case is not happening on the map, though, then I think you'll need a plugin.
*…Squint…* D’oh. Yeah, Caethyril is right, as usual. (I should have remembered that, I’ve used conditionals to check for button presses before. >.< )

Original thread: https://forums.rpgmakerweb.com/threads/how-to-check-if-a-button-is-released.154806/