Commit 570db2e7 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Restrict modifiers to Control/Mod1/Mod4, ignore NumLock (closes GH-31)

parent 39073b4c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ git HEAD
    * Add --zoom fill as equivalent for --auto-zoom
    * Add --zoom max (zooming like in --bg-max)
    * Remove support for FEH_OPTIONS (was deprecated >5 years ago)
    * Restrict available modifiers to Control/Mod1/Mod4

Sat, 22 Jan 2011 11:48:33 +0100

+1 −1
Original line number Diff line number Diff line
@@ -715,7 +715,7 @@ looks like
.Pp
Available modifiers are
.Ar C No for Control and
.Ar 1 No to Ar 5 No for Mod1 to Mod5 .
.Ar 1 , 4 No for Mod1 and Mod4 .
.Pp
Specifying an
.Ar action
+1 −11
Original line number Diff line number Diff line
@@ -58,18 +58,9 @@ static void feh_set_parse_kb_partial(fehkey *key, int index, char *ks) {
			case '1':
				mod = Mod1Mask;
				break;
			case '2':
				mod = Mod2Mask;
				break;
			case '3':
				mod = Mod3Mask;
				break;
			case '4':
				mod = Mod4Mask;
				break;
			case '5':
				mod = Mod5Mask;
				break;
			default:
				weprintf("keys: invalid modifier %c in %s", ks[0], ks);
				break;
@@ -349,8 +340,7 @@ 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 | Mod2Mask | Mod3Mask |
		Mod4Mask | Mod5Mask);
	state = kev->state & (ControlMask | Mod1Mask | Mod4Mask);

	/* menus are showing, so this is a menu control keypress */
	if (ev->xbutton.window == menu_cover) {