From 3c59abba0b907997550657633f873c9d938f670b Mon Sep 17 00:00:00 2001 From: rxi Date: Sun, 29 Dec 2019 16:32:04 +0000 Subject: [PATCH] Made keymap treat `right alt` as `altgr` modkey --- data/core/keymap.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/data/core/keymap.lua b/data/core/keymap.lua index 64c5757..fe2e45e 100644 --- a/data/core/keymap.lua +++ b/data/core/keymap.lua @@ -11,9 +11,10 @@ local modkey_map = { ["left shift"] = "shift", ["right shift"] = "shift", ["left alt"] = "alt", + ["right alt"] = "altgr", } -local modkeys = { "ctrl", "alt", "shift" } +local modkeys = { "ctrl", "alt", "altgr", "shift" } local function key_to_stroke(k) local stroke = "" @@ -55,6 +56,10 @@ function keymap.on_key_pressed(k) local mk = modkey_map[k] if mk then keymap.modkeys[mk] = true + -- work-around for windows where `altgr` is treated as `ctrl+alt` + if mk == "altgr" then + keymap.modkeys["ctrl"] = false + end else local stroke = key_to_stroke(k) local commands = keymap.map[stroke]