summaryrefslogtreecommitdiff
path: root/src/keyevents.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-01-17 20:29:57 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-01-17 20:29:57 +0100
commit5a05f95cd6c3bdeef4f5c5c66d574a71570c36f7 (patch)
treef3a54d02405c2882c9b4c7c0e8a1bdc33a68bdaa /src/keyevents.c
parentd9b4bcb1f4994d45d171cd5a71f7fe25a247094d (diff)
Ignore Shift keystate, shift/non-shift keysyms differ anyways.
Diffstat (limited to 'src/keyevents.c')
-rw-r--r--src/keyevents.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/keyevents.c b/src/keyevents.c
index 09b520d..b0bdc8d 100644
--- a/src/keyevents.c
+++ b/src/keyevents.c
@@ -54,9 +54,6 @@ static void feh_set_parse_kb_partial(fehkey *key, int index, char *ks) {
case 'C':
mod = ControlMask;
break;
- case 'S':
- mod = ShiftMask;
- break;
case '1':
mod = Mod1Mask;
break;
@@ -296,8 +293,16 @@ void init_keyevents(void) {
static short feh_is_kp(fehkey *key, int sym, int state) {
int i;
+
+ /*
+ * Regarding the | 0x1: state 1 = shift, but we don't care about that.
+ * Shift produces different keysyms than non-shift anyways.
+ */
+
for (i = 0; i < 3; i++) {
- if ((key->keysyms[i] == sym) && (key->keystates[i] == state))
+ if (
+ (key->keysyms[i] == sym) &&
+ ((key->keystates[i] | 0x1) == (state | 0x1)))
return 1;
else if (key->keysyms[i] == 0)
return 0;