0ad/source/ps/scripting
wraitii 4b46c09222 Do not trigger "HotkeyPress" events when releasing a key.
Follows d0a42f2f00.
Because only the most specific hotkeys can be active at any time,
releasing a key may require re-activating less specific hotkeys.
There were two issues with this behaviour:
- It was buggy, as it only checked one active key, when any still active
key can trigger hotkeys.
- "HotkeyPress" and "HotkeyDown" events where sent, as if the hotkey was
pressed, which was unexpected for most code/users (it is unusual to have
a "Press" event on key release).

This fixes these issues by "silently" re-triggering the hotkeys in such
a case. It also makes it easier for JS code to use "hotkeyPress" instead
of "hotkeyDown" for non-continuous behaviour.

Accepted By: nani
Fixes #6123
Refs #6064 (fixes the problem, but not the code weirdness)

Differential Revision: https://code.wildfiregames.com/D3766
This was SVN commit r25169.
2021-03-31 15:50:25 +00:00
..
JSInterface_ConfigDB.cpp Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
JSInterface_ConfigDB.h Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
JSInterface_Console.cpp Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
JSInterface_Console.h Introduce C++ templates replacements for DEFINE_INTERFACE_X and RegisterFunction macros 2021-03-01 20:52:24 +00:00
JSInterface_Debug.cpp Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
JSInterface_Debug.h Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
JSInterface_Game.cpp Netcode: allow observers to lag behind the live game. 2021-03-29 07:53:06 +00:00
JSInterface_Game.h Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
JSInterface_Hotkey.cpp Do not trigger "HotkeyPress" events when releasing a key. 2021-03-31 15:50:25 +00:00
JSInterface_Hotkey.h Introduce C++ templates replacements for DEFINE_INTERFACE_X and RegisterFunction macros 2021-03-01 20:52:24 +00:00
JSInterface_Main.cpp Do not trigger "HotkeyPress" events when releasing a key. 2021-03-31 15:50:25 +00:00
JSInterface_Main.h Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
JSInterface_Mod.cpp Introduce C++ templates replacements for DEFINE_INTERFACE_X and RegisterFunction macros 2021-03-01 20:52:24 +00:00
JSInterface_Mod.h Introduce C++ templates replacements for DEFINE_INTERFACE_X and RegisterFunction macros 2021-03-01 20:52:24 +00:00
JSInterface_ModIo.cpp Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
JSInterface_ModIo.h Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
JSInterface_SavedGame.cpp Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
JSInterface_SavedGame.h Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
JSInterface_UserReport.cpp Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
JSInterface_UserReport.h Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
JSInterface_VFS.cpp Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
JSInterface_VFS.h Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
JSInterface_VisualReplay.cpp Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
JSInterface_VisualReplay.h Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00