Made keymap treat `right alt` as `altgr` modkey
This commit is contained in:
parent
2c3e393a6f
commit
3c59abba0b
|
@ -11,9 +11,10 @@ local modkey_map = {
|
||||||
["left shift"] = "shift",
|
["left shift"] = "shift",
|
||||||
["right shift"] = "shift",
|
["right shift"] = "shift",
|
||||||
["left alt"] = "alt",
|
["left alt"] = "alt",
|
||||||
|
["right alt"] = "altgr",
|
||||||
}
|
}
|
||||||
|
|
||||||
local modkeys = { "ctrl", "alt", "shift" }
|
local modkeys = { "ctrl", "alt", "altgr", "shift" }
|
||||||
|
|
||||||
local function key_to_stroke(k)
|
local function key_to_stroke(k)
|
||||||
local stroke = ""
|
local stroke = ""
|
||||||
|
@ -55,6 +56,10 @@ function keymap.on_key_pressed(k)
|
||||||
local mk = modkey_map[k]
|
local mk = modkey_map[k]
|
||||||
if mk then
|
if mk then
|
||||||
keymap.modkeys[mk] = true
|
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
|
else
|
||||||
local stroke = key_to_stroke(k)
|
local stroke = key_to_stroke(k)
|
||||||
local commands = keymap.map[stroke]
|
local commands = keymap.map[stroke]
|
||||||
|
|
Loading…
Reference in New Issue