City17
4 years
Emulates an ESCAPE key press internally, used to interact with UI, e.g. close F10 menu.
Bug: Does not work as expected if you use it to "Cancel" something on behalf of a player, like cancel research in the current building. Since it always sends the Escape key, it will break if hotkey layout was changed from classic to grid/custom in game settings. Explanation:
1. OldPlayer plays with classic hotkey layout, the Cancelling abilities are bound to Escape.
2. ModernPlayer plays with grid layout, the Cancelling abilities' hotkey depends on their position but it's usually V.
3. ForceUICancel() is sent to both players
4. OldPlayer executes a Cancel ability, nothing happens to ModernPlayer
5. The game doesn't desync because it thinks OldPlayer really pressed that key, and even though ModernPlayer did "press" it too, he didn't trigger Cancel for his unit.
Note: Does not trigger (physical) player key events, [jassdoc]BlzTriggerRegisterPlayerKeyEvent[/jassdoc]
Bug: Does not work as expected if you use it to "Cancel" something on behalf of a player, like cancel research in the current building. Since it always sends the Escape key, it will break if hotkey layout was changed from classic to grid/custom in game settings. Explanation:
1. OldPlayer plays with classic hotkey layout, the Cancelling abilities are bound to Escape.
2. ModernPlayer plays with grid layout, the Cancelling abilities' hotkey depends on their position but it's usually V.
3. ForceUICancel() is sent to both players
4. OldPlayer executes a Cancel ability, nothing happens to ModernPlayer
5. The game doesn't desync because it thinks OldPlayer really pressed that key, and even though ModernPlayer did "press" it too, he didn't trigger Cancel for his unit.
Note: Does not trigger (physical) player key events, [jassdoc]BlzTriggerRegisterPlayerKeyEvent[/jassdoc]