diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-01-17 20:29:57 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-01-17 20:29:57 +0100 |
commit | 5a05f95cd6c3bdeef4f5c5c66d574a71570c36f7 (patch) | |
tree | f3a54d02405c2882c9b4c7c0e8a1bdc33a68bdaa | |
parent | d9b4bcb1f4994d45d171cd5a71f7fe25a247094d (diff) | |
download | feh-5a05f95cd6c3bdeef4f5c5c66d574a71570c36f7.zip |
Ignore Shift keystate, shift/non-shift keysyms differ anyways.
-rw-r--r-- | data/examples/keys | 8 | ||||
-rw-r--r-- | man/feh.pre | 3 | ||||
-rw-r--r-- | src/keyevents.c | 13 |
3 files changed, 14 insertions, 10 deletions
diff --git a/data/examples/keys b/data/examples/keys index 036d2fa..1f1f374 100644 --- a/data/examples/keys +++ b/data/examples/keys @@ -21,10 +21,10 @@ remove l Delete delete C-l C-Delete # and image movement -scroll_up S-J C-Up -scroll_down S-K C-Down -scroll_left S-H C-Left -scroll_right S-L C-Right +scroll_up J C-Up +scroll_down K C-Down +scroll_left H C-Left +scroll_right L C-Right # zooming zoom_in C-Up f diff --git a/man/feh.pre b/man/feh.pre index 3811d07..3c505f7 100644 --- a/man/feh.pre +++ b/man/feh.pre @@ -698,8 +698,7 @@ looks like .Pq for example Qo C-Delete Qc for Ctrl+Delete . .Pp Available modifiers are -.Ar C No for Control , -.Ar S No for Shift and +.Ar C No for Control and .Ar 1 No to Ar 5 No for Mod1 to Mod5 . .Pp Specifying an 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; |