diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2023-11-25 15:20:55 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2023-11-25 15:20:55 -0800 |
commit | f6420efd908b68fa881169729c46def2899b5790 (patch) | |
tree | 8fd41f88a748e252be2794685fb47fac6f0f0038 | |
parent | c1f7f17f9caa70ffc4857f64db59ff41741b0caf (diff) | |
download | lines.love-f6420efd908b68fa881169729c46def2899b5790.tar.gz |
improved handling of other keyboard layouts
-rw-r--r-- | text.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/text.lua b/text.lua index 2383137..44846e3 100644 --- a/text.lua +++ b/text.lua @@ -125,7 +125,14 @@ end function Text.text_input(State, t) if App.mouse_down(1) then return end - if App.ctrl_down() or App.alt_down() or App.cmd_down() then return end + if App.any_modifier_down() then + if App.key_down(t) then + -- The modifiers didn't change the key. Handle it in keychord_pressed. + return + else + -- Key mutated by the keyboard layout. Continue below. + end + end local before = snapshot(State, State.cursor1.line) --? print(State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos, State.screen_bottom1.line, State.screen_bottom1.pos) Text.insert_at_cursor(State, t) |