Dont send events for modifier keys unless in all key mode
This commit is contained in:
@@ -31,6 +31,10 @@ typedef struct {
|
||||
KeyAction action;
|
||||
} EncodingData;
|
||||
|
||||
static inline bool
|
||||
is_modifier_key(uint32_t key) {
|
||||
return GLFW_FKEY_LEFT_SHIFT <= key && key <= GLFW_FKEY_RIGHT_SUPER;
|
||||
}
|
||||
|
||||
static inline void
|
||||
convert_glfw_mods(int mods, KeyEvent *ev) {
|
||||
@@ -344,6 +348,7 @@ encode_glfw_key_event(const GLFWkeyevent *e, const bool cursor_key_mode, const u
|
||||
.report_text = key_encoding_flags & 8,
|
||||
.embed_text = key_encoding_flags & 16
|
||||
};
|
||||
if (!ev.report_text && is_modifier_key(e->key)) return 0;
|
||||
ev.has_text = e->text && !is_ascii_control_char(e->text[0]);
|
||||
bool send_text_standalone = !ev.report_text;
|
||||
if (!ev.disambiguate && GLFW_FKEY_KP_0 <= ev.key && ev.key <= GLFW_FKEY_KP_DELETE) {
|
||||
|
||||
Reference in New Issue
Block a user