summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-03-03 11:57:40 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-03-03 11:58:51 +0200
commit5b1b19d6d0e07103cdeb8df2dcd838fe67a923cd (patch)
tree6509e3f70c9fb23f6575cbcf5a35754635e5d27c /src/app.c
parent12630f504b022b0718655a615d2fbb1d045ded18 (diff)
Load keyboard modifier mapping from modmap.txt
IssueID #87
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/app.c b/src/app.c
index 5c04fd92..b1036ffe 100644
--- a/src/app.c
+++ b/src/app.c
@@ -896,6 +896,15 @@ void processEvents_App(enum iAppEventMode eventMode) {
896 d->isIdling = iFalse; 896 d->isIdling = iFalse;
897#endif 897#endif
898 gotEvents = iTrue; 898 gotEvents = iTrue;
899 /* Keyboard modifier mapping. */ {
900 if (ev.type == SDL_KEYDOWN || ev.type == SDL_KEYUP) {
901 /* Track Caps Lock state as a modifier. */
902 if (ev.key.keysym.sym == SDLK_CAPSLOCK) {
903 setCapsLockDown_Keys(ev.key.state == SDL_PRESSED);
904 }
905 ev.key.keysym.mod = mapMods_Keys(ev.key.keysym.mod & ~KMOD_CAPS);
906 }
907 }
899 iBool wasUsed = processEvent_Window(d->window, &ev); 908 iBool wasUsed = processEvent_Window(d->window, &ev);
900 if (!wasUsed) { 909 if (!wasUsed) {
901 /* There may be a key bindings for this. */ 910 /* There may be a key bindings for this. */