Krolyxon
Commit 4396031

Branches

Refs →

nsxiv4396031

switch back to whitelisting modifers (#150)

* Revert "Allow any set of modifiers to be used in keybindings"

this keeps things equal with sxiv while giving users possibility to
customize USED_MODMASK if they wish.

This reverts commit 3234b0e521cca006a94cb135a88d146122d7f66d.

Closes: https://github.com/nsxiv/nsxiv/issues/149
Closes: https://github.com/nsxiv/nsxiv/issues/123
Author
N-R-K
Date
2021-11-24 17:44 +0600
Committer
GitHub · 2021-11-24 11:44 +0000
Parent
0262988
Commit
43960312333bc9d9a6a8a95fff3563044856eccf

+4 −4

2 files changed

  1. M config.def.h +3 −3
  2. M main.c +1 −1
M config.def.h View
@@ -42,7 +42,7 @@ static const int SLIDESHOW_DELAY = 5;
4242
4343 /* gamma correction: the user-visible ranges [-GAMMA_RANGE, 0] and
4444 * (0, GAMMA_RANGE] are mapped to the ranges [0, 1], and (1, GAMMA_MAX].
45− * */
45+ */
4646 static const double GAMMA_MAX = 10.0;
4747 static const int GAMMA_RANGE = 32;
4848
@@ -71,8 +71,8 @@ static const int THUMB_SIZE = 3;
7171 #endif
7272 #ifdef _MAPPINGS_CONFIG
7373
74−/* following modifiers (NumLock | CapsLock) will be ignored when processing keybindings */
75−static const int ignore_mask = Mod2Mask | LockMask;
74+/* these modifiers will be used when processing keybindings */
75+static const unsigned int USED_MODMASK = ShiftMask | ControlMask | Mod1Mask;
7676
7777 /* abort the keyhandler */
7878 static const KeySym KEYHANDLER_ABORT = XK_Escape;
M main.c View
@@ -36,7 +36,7 @@
3636 #include <X11/keysym.h>
3737 #include <X11/XF86keysym.h>
3838
39−#define MODMASK(mask) ((mask) & ~ignore_mask)
39+#define MODMASK(mask) ((mask) & USED_MODMASK)
4040 #define BAR_SEP " "
4141
4242 typedef struct {