HomeWildfire Games

Do not trigger "HotkeyPress" events when releasing a key.

Description

Do not trigger "HotkeyPress" events when releasing a key.

Follows rP24675.
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

Event Timeline

Imarok raised a concern with this commit.Apr 1 2021, 12:05 AM
Imarok added a subscriber: Imarok.

Scrolling is broken for me (Ubuntu Gnome) with this commit:

  • Start a game
  • press W and release it
  • scroll towards the cable of the mouse
  • the scrolling has no effect.
This commit now has outstanding concerns.Apr 1 2021, 12:05 AM

Scrolling is broken for me (Ubuntu Gnome) with this commit:

  • Start a game
  • press W and release it
  • scroll towards the cable of the mouse
  • the scrolling has no effect.

Hmm, seems like I now can sometimes also reproduce it on r25168. Strange. Seems like I have to do more testing

  • scroll towards the cable of the mouse

You mean "scroll up with the mouse"?


I'll check.

I can confirm that when using W to scroll the map and using my mousepad to zoom in or out the scrolling stops after this revision, but not before.

Imarok added a comment.Apr 1 2021, 9:51 AM
  • scroll towards the cable of the mouse

You mean "scroll up with the mouse"?

Up and down are bit unclear for scrolling.
But yeah, I'd call it scrolling up. xD

Imarok resigned from this commit.Apr 3 2021, 4:19 PM

Seems to be fixed by rP25176 ๐Ÿ‘

This commit no longer requires audit.Apr 3 2021, 4:19 PM