diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-08-02 18:33:13 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-08-02 18:33:13 +0200 |
commit | 7f2e2a305f02aa5bb242d6ac9547843feec433db (patch) | |
tree | 0040186417171ecc420411392e9ee14147cd2550 /src | |
parent | 0047a2d08b11739aadeb4a8c28ef87416e7e11a5 (diff) |
keyevents.c: Support Shift modifier (see github issue #30, patch by Yu-Jie Lin)
Diffstat (limited to 'src')
-rw-r--r-- | src/keyevents.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/keyevents.c b/src/keyevents.c index 12e9f73..526e0ac 100644 --- a/src/keyevents.c +++ b/src/keyevents.c @@ -55,6 +55,9 @@ 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; @@ -69,6 +72,8 @@ static void feh_set_parse_kb_partial(fehkey *key, int index, char *ks) { } key->keysyms[index] = XStringToKeysym(cur); + if (isascii(key->keysyms[index])) + mod &= ~ShiftMask; key->keystates[index] = mod; if (key->keysyms[index] == NoSymbol) @@ -358,7 +363,10 @@ void feh_event_handle_keypress(XEvent * ev) kev = (XKeyEvent *) ev; len = XLookupString(&ev->xkey, (char *) kbuf, sizeof(kbuf), &keysym, NULL); - state = kev->state & (ControlMask | Mod1Mask | Mod4Mask); + state = kev->state & (ControlMask | ShiftMask | Mod1Mask | Mod4Mask); + + if (isascii(keysym)) + state &= ~ShiftMask; /* menus are showing, so this is a menu control keypress */ if (ev->xbutton.window == menu_cover) { |