Follow-up Comment #1, bug #20251 (project wesnoth):

I noticed this problem too, and did some digging.  The problem is that there
is some confusion when to use the character typed, and when to use the
keycode.  I have a patch that fixes this problem.

svn diff src/hotkeys.cpp
Index: src/hotkeys.cpp
===================================================================
--- src/hotkeys.cpp     (revision 55565)
+++ src/hotkeys.cpp     (working copy)
@@ -468,7 +468,7 @@
                   << "n";
 
        // Sometimes control modifies by -64, ie ^A == 1.
-       if (character < 64 && ctrl) {
+       if (0 < character && character < 64 && ctrl && !isspace(character)) {
                if (shift) {
                        character += 64; }
                else {
@@ -652,7 +652,7 @@
                << "n";
 
        // Sometimes control modifies by -64, ie ^A == 1.
-       if (0 < character && character < 64 && ctrl) {
+       if (0 < character && character < 64 && ctrl && !isspace(character)) {
                if (shift) {
                        character += 64;
                } else {
@@ -666,6 +666,13 @@
        if (cmd && character > 96 && character < 123 && shift) {
                character -= 32; }
 
+       if (isprint(character) && !isspace(character)) {
+               LOG_G << "type = BY_CHARACTERn";
+       } else {
+               character = -1;
+               LOG_G << "type = BY_KEYCODEn";
+       }
+
        bool found = false;
 
        for (itor = hotkeys_.begin(); itor != hotkeys_.end(); ++itor) {


    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?20251>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to