summaryrefslogtreecommitdiff
path: root/src/ui/util.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-11-21 15:07:49 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-11-21 15:07:49 +0200
commita6314e152b2d2f306bcbb880356d3890efbfc89e (patch)
tree574e5a78d63a5149213c0f9d68f4591af1e17e1f /src/ui/util.c
parent6d24d800df86e11c5686d50437932a711af82915 (diff)
Keyboard navigation mode for home row keys
Now there are keybindings for activating the keyboard navigation modes. The modifier-based mode remains as it was before, focusing on numbers, while the home row mode uses a separate activation key. One can erase the bindings to disable the corresponding modes. IssueID #34
Diffstat (limited to 'src/ui/util.c')
-rw-r--r--src/ui/util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ui/util.c b/src/ui/util.c
index 559c5381..c1312062 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -117,6 +117,14 @@ iBool isMod_Sym(int key) {
117 key == SDLK_LGUI || key == SDLK_RGUI || key == SDLK_LSHIFT || key == SDLK_RSHIFT; 117 key == SDLK_LGUI || key == SDLK_RGUI || key == SDLK_LSHIFT || key == SDLK_RSHIFT;
118} 118}
119 119
120int normalizedMod_Sym(int key) {
121 if (key == SDLK_RSHIFT) key = SDLK_LSHIFT;
122 if (key == SDLK_RCTRL) key = SDLK_LCTRL;
123 if (key == SDLK_RALT) key = SDLK_LALT;
124 if (key == SDLK_RGUI) key = SDLK_LGUI;
125 return key;
126}
127
120int keyMods_Sym(int kmods) { 128int keyMods_Sym(int kmods) {
121 kmods &= (KMOD_SHIFT | KMOD_ALT | KMOD_CTRL | KMOD_GUI); 129 kmods &= (KMOD_SHIFT | KMOD_ALT | KMOD_CTRL | KMOD_GUI);
122 /* Don't treat left/right modifiers differently. */ 130 /* Don't treat left/right modifiers differently. */