Opened 3 years ago

Last modified 3 years ago

#6123 closed defect

Do not execute multiple keyboard hotkey events if another hotkey in released simultaneously. — at Version 3

Reported by: nani Owned by:
Priority: Should Have Milestone: Alpha 25
Component: Core engine Keywords: hotkeys keyboard events multiple handlers
Cc: Patch:

Description (last modified by nani)

Example case: you have two different hotkeys.

"hotkeyA" : "Ctrl+H"
"hotkeyB" : "H"

both have an onKeyDown handler defined.

1) press Ctrl+H: an event "hotkeyA" type "hotkeydown" is fired, the handler is executed
2) release only Ctrl: an event "hotkeyA" type "hotkeyup" is fired AND at the same time (meaning processed in the same tick or whatever is it) and event "hotkeyB" of type "hotkeydown" is fired, the handler for "hotkeyB" is executed

What changed from a23 to a24 that didn't cause this problem? "hotkeyB" wasn't triggered at the same time "hotkeyA" was released, instead it was (ignored implicitly?) executed when the event fired a little more after (the OS keyboard wait time before a pressed key repeats, aprox 500 ms in my case) and the initial "hotkeydown" for "hotkeyB" was never fired.

Possible solutions:
A) Filter out all "hotkeydown" hotkeys from being processed if on the list of events to be processed there is at least one event of type "hotkeyup"

B) Don't fire a "hotkeydown" when that hotkey was already in a theoretical "hotkeydown" state.

Change History (3)

comment:1 by wraitii, 3 years ago

See also #6064

--

I think your description confuses the hotkeys & also you're missing the 'hotkeypress' logic.

--

I don't think 'hotkeydown' is the problem, just hotkeypress.

Last edited 3 years ago by wraitii (previous) (diff)

comment:2 by nani, 3 years ago

What makes it so that hotkeydown is not a problem?

comment:3 by nani, 3 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.