0ad/source
Ykkrosh 2d1be3d47e Improve correctness of hotkeys at low framerates.
SDL queues up all the input events received in a frame. When the hotkey
system saw a key up/down event, it immediately updated its
HotkeyIsPressed state and then pushed a hotkey event onto the end of the
queue.

If the initial queue was e.g. [key-down shift, key-press Z, key-up
shift], the hotkey event triggered by Z would be processed after the
key-up shift had updated the HotkeyIsPressed state, so the handler of
the Z hotkey would not think the shift hotkey was pressed.

If the initial queue was e.g. [key-press Z, mouse-click], the hotkey
triggered by Z would be processed after the mouse-click event, so it
could apply to the wrong building selection.

Fix by pushing the hotkey events onto a special queue that gets
processed before any subsequent SDL input events.

Also update the HotkeyIsPressed status when the HOTKEYDOWN/HOTKEYUP
events are processed, not when they are generated, to guarantee they are
consistent with the DOWN/UP events.

Fixes #1869.

This was SVN commit r14057.
2013-10-30 01:38:32 +00:00
..
collada Delete bogus file 2013-09-14 12:19:22 +00:00
graphics Fix non-PCH build 2013-10-19 01:11:20 +00:00
gui Use CStrIntern for font names to reduce lookup cost 2013-10-18 16:15:42 +00:00
lib Improve correctness of hotkeys at low framerates. 2013-10-30 01:38:32 +00:00
maths Unify script conversions and remove JSInterface_Vector3D. 2013-10-20 17:13:53 +00:00
mocks More FreeBSD build fixes. 2012-01-30 06:21:11 +00:00
network Fixes hypothetical mem leak in network code (and an error in Cppcheck), patch by Riemer, fixes #2122 2013-10-10 23:46:42 +00:00
pch More build fixes for FreeBSD. 2012-01-31 00:06:56 +00:00
ps Improve correctness of hotkeys at low framerates. 2013-10-30 01:38:32 +00:00
renderer Use CStrIntern for font names to reduce lookup cost 2013-10-18 16:15:42 +00:00
scripting Unify script conversions and remove JSInterface_Vector3D. 2013-10-20 17:13:53 +00:00
scriptinterface Unify script conversions and remove JSInterface_Vector3D. 2013-10-20 17:13:53 +00:00
simulation2 Fix some Clang warnings about unused private members 2013-10-19 00:53:58 +00:00
soundmanager Remove useless error messages. 2013-10-20 01:47:16 +00:00
third_party Fix build warnings. Patch by Markus. Refs #1851. 2013-06-11 00:05:57 +00:00
tools Improve correctness of hotkeys at low framerates. 2013-10-30 01:38:32 +00:00
contributors.txt Ticket #2127 - Performance and style improvements in scriptinterface. 2013-09-16 19:10:06 +00:00
main.cpp Improve correctness of hotkeys at low framerates. 2013-10-30 01:38:32 +00:00
test_setup.cpp Adds UTF-8 support for JavaScript files. 2012-05-04 21:48:46 +00:00