summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2013-01-07 14:50:50 +0400
committerAndrey Nazarov <skuller@skuller.net>2013-01-07 17:03:52 +0400
commita9ebb23c4084b12e4eed1a8df658825c0a7b5042 (patch)
tree7d6697043e6267c835866e4004f1030d304194b3 /src
parent0bb58977602034feb3f34721bae3abb11e8b00cf (diff)
Make key bindings case insensitive.
Handling Shift modifier for keybindings is a flawed approach: actions are supposed to be bound to physical keys. If there is any need for modifier keys, they can be emulated with scripting magic.
Diffstat (limited to 'src')
-rw-r--r--src/client/keys.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/client/keys.c b/src/client/keys.c
index 754c04e..065cf3a 100644
--- a/src/client/keys.c
+++ b/src/client/keys.c
@@ -238,7 +238,7 @@ int Key_StringToKeynum(const char *str)
if (!str || !str[0])
return -1;
if (!str[1])
- return str[0];
+ return Q_tolower(str[0]);
for (kn = keynames; kn->name; kn++) {
if (!Q_stricmp(str, kn->name))
@@ -731,14 +731,6 @@ void Key_Event(unsigned key, qboolean down, unsigned time)
kb + 1, key, time);
Cbuf_AddText(&cmd_buffer, cmd);
}
- if (keyshift[key] != key) {
- kb = keybindings[keyshift[key]];
- if (kb && kb[0] == '+') {
- Q_snprintf(cmd, sizeof(cmd), "-%s %i %i\n",
- kb + 1, key, time);
- Cbuf_AddText(&cmd_buffer, cmd);
- }
- }
Q_ClearBit(buttondown, key);
return;
}
@@ -751,10 +743,6 @@ void Key_Event(unsigned key, qboolean down, unsigned time)
// generate button up command when released
Q_SetBit(buttondown, key);
- if (Key_IsDown(K_SHIFT) && keyshift[key] != key && keybindings[keyshift[key]]) {
- key = keyshift[key];
- }
-
kb = keybindings[key];
if (kb) {
if (kb[0] == '+') {