diff options
Diffstat (limited to 'src/internal.c')
-rw-r--r-- | src/internal.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/internal.c b/src/internal.c index cff66be..b3ee86a 100644 --- a/src/internal.c +++ b/src/internal.c @@ -116,6 +116,29 @@ puglDecodeUTF8(const uint8_t* buf) return 0xFFFD; } +PuglMods +puglFilterMods(const PuglMods state, const PuglKey key) +{ + switch (key) { + case PUGL_KEY_SHIFT_L: + case PUGL_KEY_SHIFT_R: + return state & ~(PuglMods)PUGL_MOD_SHIFT; + case PUGL_KEY_CTRL_L: + case PUGL_KEY_CTRL_R: + return state & ~(PuglMods)PUGL_MOD_CTRL; + case PUGL_KEY_ALT_L: + case PUGL_KEY_ALT_R: + return state & ~(PuglMods)PUGL_MOD_ALT; + case PUGL_KEY_SUPER_L: + case PUGL_KEY_SUPER_R: + return state & ~(PuglMods)PUGL_MOD_SUPER; + default: + break; + }; + + return state; +} + PuglStatus puglPreRealize(PuglView* const view) { |