Made keymap treat `right alt` as `altgr` modkey

This commit is contained in:
rxi 2019-12-29 16:32:04 +00:00
parent 2c3e393a6f
commit 3c59abba0b
1 changed files with 6 additions and 1 deletions

View File

@ -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]