]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - keys.c
added c_nodes, c_leafs, and c_faces increments in q3bsp rendering to make r_speeds...
[xonotic/darkplaces.git] / keys.c
diff --git a/keys.c b/keys.c
index 02a3f8080b13986014b2967a38ee5aa28e3f4429..fab2478bd327e31b0ca903046968f002d341175e 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -18,6 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 */
 #include "quakedef.h"
+#include <ctype.h>
 
 /*
 
@@ -515,7 +516,7 @@ int Key_StringToKeynum (const char *str)
        if (!str || !str[0])
                return -1;
        if (!str[1])
-               return str[0];
+               return tolower(str[0]);
 
        for (kn=keynames ; kn->name ; kn++)
                if (!strcasecmp(str,kn->name))
@@ -811,7 +812,10 @@ void Key_Event (int key, char ascii, qboolean down)
                        MR_ToggleMenu_f ();
                        break;
                default:
-                       Sys_Error ("Bad key_dest");
+                       if(UI_Callback_IsSlotUsed(key_dest - 3))
+                               UI_Callback_KeyDown (key, ascii);
+                       else
+                               Sys_Error ("Bad key_dest");
                }
                return;
        }
@@ -835,18 +839,13 @@ void Key_Event (int key, char ascii, qboolean down)
                }
        }
 
-       // AK What the fuck ?!?
+       // AK New WTF ?!?
        // AK Changed so the code does what the comments tell 
        // 
        // 1. if console is active or not, always send the up events
+       // console only wants key down events
        if (key_consoleactive && consolekeys[key] && down)
-       {
-               // console only wants key down events
-               //if (!down)
-               //      return;
-
                Key_Console (key, ascii);
-       }
        else
        {
                //
@@ -898,9 +897,6 @@ void Key_Event (int key, char ascii, qboolean down)
                        return;
                }
 
-               if (!down)
-                       return;         // other systems only care about key down events
-
                switch (key_dest)
                {
                case key_message:
@@ -915,7 +911,10 @@ void Key_Event (int key, char ascii, qboolean down)
                        Key_Console (key, ascii);
                        break;
                default:
-                       Sys_Error ("Bad key_dest");
+                       if(UI_Callback_IsSlotUsed(key_dest - 3))
+                               UI_Callback_KeyDown (key, ascii);
+                       else
+                               Sys_Error ("Bad key_dest");
                }
        }
 }