foxygit / doom Log in
commit 30952764cf640001a2e8a0e2e4fefec734b147d9
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sun Apr 17 17:33:04 2011 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sun Apr 17 17:33:04 2011 +0000

    Fix libtextscreen window hotkeys to work when shift is held down /
    capslock turned on. Fix a similar problem in-game when typing cheat
    codes or using menu hotkeys (thanks Alexandre Xavier).

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 2327
---
 NEWS                           | 5 +++++
 src/i_video.c                  | 2 +-
 textscreen/txt_window_action.c | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 1cfca6a7..8a66fb2b 100644
--- a/NEWS
+++ b/NEWS
@@ -50,6 +50,8 @@
        file (thanks Alexandre Xavier).
      * Default sampling rate used by setup tool changed to 44100Hz, to
        match the game default (thanks Alexandre Xavier).
+     * Cheat codes and menu hot keys now work when shift is held down
+       or capslock turned on (thanks Alexandre Xavier).

     libtextscreen:
      * The background on GUI controls now lights up when hovering over
@@ -62,6 +64,9 @@
        matching location.
      * Clicking outside a dropdown list popup window now dismisses the
        window.
+     * Window hotkeys that are an alphabetical letter now work when
+       shift is held down or capslock turned on (thanks Alexandre
+       Xavier).

 1.5.0 (2011-01-02):

diff --git a/src/i_video.c b/src/i_video.c
index cd5d2ace..15e4a6b7 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -563,7 +563,7 @@ void I_GetEvent(void)
                 }
                 else
                 {
-                    event.data2 = sdlevent.key.keysym.unicode;
+                    event.data2 = tolower(sdlevent.key.keysym.unicode);
                 }

                 if (event.data1 != 0)
diff --git a/textscreen/txt_window_action.c b/textscreen/txt_window_action.c
index 81d3e94d..df0e4ea3 100644
--- a/textscreen/txt_window_action.c
+++ b/textscreen/txt_window_action.c
@@ -82,7 +82,7 @@ static int TXT_WindowActionKeyPress(TXT_UNCAST_ARG(action), int key)
 {
     TXT_CAST_ARG(txt_window_action_t, action);

-    if (key == action->key)
+    if (tolower(key) == tolower(action->key))
     {
         TXT_EmitSignal(action, "pressed");
         return 1;