Ignore keypresses during IME composition (#1573)
Some IMEs continue sending keypresses even during composition, so we just ignore them.
This commit is contained in:
parent
9612f20685
commit
7e20424b29
|
@ -1278,6 +1278,9 @@ function core.on_event(type, ...)
|
||||||
elseif type == "textediting" then
|
elseif type == "textediting" then
|
||||||
ime.on_text_editing(...)
|
ime.on_text_editing(...)
|
||||||
elseif type == "keypressed" then
|
elseif type == "keypressed" then
|
||||||
|
-- In some cases during IME composition input is still sent to us
|
||||||
|
-- so we just ignore it.
|
||||||
|
if ime.editing then return false end
|
||||||
did_keymap = keymap.on_key_pressed(...)
|
did_keymap = keymap.on_key_pressed(...)
|
||||||
elseif type == "keyreleased" then
|
elseif type == "keyreleased" then
|
||||||
keymap.on_key_released(...)
|
keymap.on_key_released(...)
|
||||||
|
|
|
@ -203,10 +203,6 @@ end
|
||||||
-- Events listening
|
-- Events listening
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
function keymap.on_key_pressed(k, ...)
|
function keymap.on_key_pressed(k, ...)
|
||||||
-- In MacOS and Windows during IME composition input is still sent to us
|
|
||||||
-- so we just ignore it
|
|
||||||
if PLATFORM ~= "Linux" and ime.editing then return false end
|
|
||||||
|
|
||||||
local mk = modkey_map[k]
|
local mk = modkey_map[k]
|
||||||
if mk then
|
if mk then
|
||||||
keymap.modkeys[mk] = true
|
keymap.modkeys[mk] = true
|
||||||
|
|
Loading…
Reference in New Issue