[Commits] [wesnoth/wesnoth] 0b5ed4: Improve hot-key handling for SDL 1.2 builds
GitHub
noreply at github.com
Sun Oct 25 02:01:58 UTC 2015
Branch: refs/heads/1.12
Home: https://github.com/wesnoth/wesnoth
Commit: 0b5ed477c35ef7ce7cb553d26afb5378acb83237
https://github.com/wesnoth/wesnoth/commit/0b5ed477c35ef7ce7cb553d26afb5378acb83237
Author: Wedge009 <wedge009 at wedge009.net>
Date: 2015-10-20 (Tue, 20 Oct 2015)
Changed paths:
M src/hotkey/hotkey_item.cpp
Log Message:
-----------
Improve hot-key handling for SDL 1.2 builds
This is an extension of #450 and a correction of #470. The sdl2 branch already contains a superset of the improvements made here and will eventually be merged into master, thus overriding this work. So only include these changes in the current 1.12.x release branch.
To ensure we don't have a repeat of the mistakes in #470 I tested the following combinations (mostly Windows, some in Linux):
letter (a, b, c, etc)
punctuation (;, ., etc)
function (F1, F2, F3, etc)
Shift+letter
Shift+punctuation
Shift+function
Ctrl+Return
Ctrl+Enter
Ctrl+j
Ctrl+m
Ctrl+function
Ctrl+`
Ctrl+Shift+2 (@ on US keyboards)
Ctrl+;
Ctrl+Shift+; (colon on US keyboards)
Ctrl+Tab
Ctrl+PrintScreen
Ctrl+Pause
Ctrl+Insert
Ctrl+Delete
Ctrl+Home
Ctrl+End
Ctrl+PageUp
Ctrl+PageDown
Ctrl+Alt
Ctrl+Ctrl
Ctrl+Space
Ctrl+Alt+Space
Ctrl+direction
Ctrl+Shift
Ctrl+CapsLock
Ctrl+NumLock
Ctrl+ScrollLock
Revision of notes from #470:
Instead of specifically checking for Ctrl+j and Ctrl+m, I now make this a general check: that letters should match their respective key codes. This will still cover the Ctrl+Return/Enter combination fixed in #450, but also some of the combinations noted by others testing that PR.
Ctrl+Tab was one combination noted to not work in Linux (though it did in Windows) as it was being mis-read as Ctrl+i. Ctrl+Tab will now work correctly in Linux.
Strangely, Ctrl+Scroll Lock and Ctrl+Pause (while working in Linux) were both being mis-read as Ctrl+c in Windows. This change will cover Ctrl+Scroll Lock but Ctrl+Pause will also be read as Ctrl+Scroll Lock, because of the key code SDL detects. Similarly, Ctrl+Num Lock becomes Ctrl+Pause instead. I don't think this can be resolved because the key code is simply being read incorrectly (this includes SDL 1.2 and SDL 2.0 in Windows).
Unfortunately, I cannot test whether there will be any improvement or regression in OS X.
With hot-key handling being rewritten for SDL2 this change may seem moot, but it will still improve things for the current 1.12 release. This change also resolves concerns some have had regarding the special-case nature of the Ctrl+j/Ctrl+m check previously used.
Commit: 60b52761dd421ad416904811da9155c37a4ee30a
https://github.com/wesnoth/wesnoth/commit/60b52761dd421ad416904811da9155c37a4ee30a
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2015-10-24 (Sat, 24 Oct 2015)
Changed paths:
M changelog
Log Message:
-----------
Update changelog
Compare: https://github.com/wesnoth/wesnoth/compare/ec1cb54aa3b3...60b52761dd42
More information about the Commits
mailing list