Lock keys should not be sent to applications in legacy mode

This commit is contained in:
Kovid Goyal 2021-01-19 08:55:01 +05:30
parent f0ae5dfc73
commit dd08896c70
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -33,7 +33,16 @@ typedef struct {
static inline bool
is_modifier_key(uint32_t key) {
return GLFW_FKEY_LEFT_SHIFT <= key && key <= GLFW_FKEY_RIGHT_SUPER;
START_ALLOW_CASE_RANGE
switch (key) {
case GLFW_FKEY_LEFT_SHIFT ... GLFW_FKEY_RIGHT_SUPER:
case GLFW_FKEY_CAPS_LOCK:
case GLFW_FKEY_SCROLL_LOCK:
case GLFW_FKEY_NUM_LOCK:
return true;
default:
return false;
}
}
static inline void