Adding a keyup event listener likely isn't the way to go here because there is already a keyup event listener on the key, that's how the other input handler is able to deal with it in the first place. What is it you're actually trying to do?
OK, that's clearer. 👋
I don't know what your setup looks like, but I would consider making an Autorun event to manually handle all player inputs: movement, gun, grenade. Use Conditional Branch -> [Button] is pressed to check each button, and respond appropriately. Autorun/Parallel events trigger every frame that they're not already running; non-Parallel events also replace normal input responses, e.g. player movement.
If the player can move freely, Parallel may be a better choice than Autorun: then only the gun & grenade inputs need to be checked.
A switch can be used to track whether a button was pressed last frame or not, e.g.
◆If:Button [Cancel] is pressed down
◆If:#0001 Grenade is OFF
◆Control Switches:#0001 Grenade = ON
◆Text:None, Window, Bottom
: :Throw grenade!
◆
:End
◆
:Else
◆If:#0001 Grenade is ON
◆Control Switches:#0001 Grenade = OFF
◆
:End
◆
:End
Alternatively you can use Conditional Branch -> Script: Input.isTriggered("cancel"). This will pass only when the button is pressed this frame and was not pressed last frame.
Ok this is what I have as first autorun common event but it doesn't show the message when I press ok (enter)
◆If:Button [OK] is pressed down
◆Text:None, Window, Bottom
: :Test!
◆
:End
Autorun common events have a switch. They are only active when their switch is on. Have you turned that switch on?
It depends when you want your ABS to start (and stop). If you want to turn it on when you enter a map, you can use an Autorun map event like this:
◆Control Switches:#0015 ABS Active = ON
◆Erase Event
Erase Event makes the event disappear until you leave and return to the map. So this turns the switch on once, each time you arrive on that map.
still having problem with reading the esc input, when I press esc my script gets called but also the esc menu shows up. this is unwanted
◆If:Button [Cancel] is pressed down
◆If:IsCancelPressed is OFF
◆Control Switches:#0003 IsCancelPressed = ON
◆Script:TacticalBattle.cancelTurn();
◆
:End
◆
:Else
◆If:IsCancelPressed is ON
◆Control Switches:#0003 IsCancelPressed = OFF
◆
:End
◆
:End
maybe the problem is that i run it as Pareller because when i try Autorun the whole game freezes
The Change Menu Access event command enables/disables the pause menu.