summaryrefslogtreecommitdiff
path: root/src/ui/window.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-03-03 11:03:47 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-03-03 11:58:51 +0200
commite0f586866ebafa296bda849b392d09fc2e14d487 (patch)
tree5536cf6f56f9c71db6b24cc185618387c35bdf4d /src/ui/window.c
parent76f9ab985c135c6f691276b4edd0c340a6bc2de1 (diff)
CapsLock as a modifier key; adding a modifier mapping table
IssueID #87
Diffstat (limited to 'src/ui/window.c')
-rw-r--r--src/ui/window.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ui/window.c b/src/ui/window.c
index 3518d97e..cbcca902 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -1532,6 +1532,7 @@ static iBool handleWindowEvent_Window_(iWindow *d, const SDL_WindowEvent *ev) {
1532 return iTrue; 1532 return iTrue;
1533 case SDL_WINDOWEVENT_FOCUS_GAINED: 1533 case SDL_WINDOWEVENT_FOCUS_GAINED:
1534 d->focusGainedAt = SDL_GetTicks(); 1534 d->focusGainedAt = SDL_GetTicks();
1535 setCapsLockDown_Keys(iFalse);
1535 postCommand_App("window.focus.gained"); 1536 postCommand_App("window.focus.gained");
1536 return iFalse; 1537 return iFalse;
1537 case SDL_WINDOWEVENT_FOCUS_LOST: 1538 case SDL_WINDOWEVENT_FOCUS_LOST:
@@ -1593,6 +1594,13 @@ iBool processEvent_Window(iWindow *d, const SDL_Event *ev) {
1593 As a workaround, ignore these events. */ 1594 As a workaround, ignore these events. */
1594 return iTrue; /* won't go to bindings, either */ 1595 return iTrue; /* won't go to bindings, either */
1595 } 1596 }
1597 /* Apply keyboard modifier mapping. */
1598 if (event.type == SDL_KEYDOWN || event.type == SDL_KEYUP) {
1599 if (event.key.keysym.sym == SDLK_CAPSLOCK) {
1600 setCapsLockDown_Keys(event.key.state == SDL_PRESSED);
1601 }
1602 event.key.keysym.mod = mapMods_Keys(event.key.keysym.mod & ~KMOD_CAPS);
1603 }
1596 if (event.type == SDL_MOUSEBUTTONDOWN && d->ignoreClick) { 1604 if (event.type == SDL_MOUSEBUTTONDOWN && d->ignoreClick) {
1597 d->ignoreClick = iFalse; 1605 d->ignoreClick = iFalse;
1598 return iTrue; 1606 return iTrue;