diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-03 11:57:40 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-03 11:58:51 +0200 |
commit | 5b1b19d6d0e07103cdeb8df2dcd838fe67a923cd (patch) | |
tree | 6509e3f70c9fb23f6575cbcf5a35754635e5d27c /src/app.c | |
parent | 12630f504b022b0718655a615d2fbb1d045ded18 (diff) |
Load keyboard modifier mapping from modmap.txt
IssueID #87
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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. */ |