Add macos keybindings

Thanks to @mathewmariani, modifications taken from his lite-macos repository
This commit is contained in:
Francesco Abbate
2021-04-21 09:48:30 +02:00
parent f50728bf18
commit 80192573da
4 changed files with 150 additions and 9 deletions
+11 -9
View File
@@ -5,16 +5,12 @@ keymap.modkeys = {}
keymap.map = {}
keymap.reverse_map = {}
local modkey_map = {
["left ctrl"] = "ctrl",
["right ctrl"] = "ctrl",
["left shift"] = "shift",
["right shift"] = "shift",
["left alt"] = "alt",
["right alt"] = "altgr",
}
local macos = rawget(_G, "MACOS_RESOURCES")
local modkeys = { "ctrl", "alt", "altgr", "shift" }
-- Thanks to mathewmariani, taken from his lite-macos github repository.
local modkeys_os = require("core.modkeys-" .. (macos and "macos" or "generic"))
local modkey_map = modkeys_os.map
local modkeys = modkeys_os.keys
local function key_to_stroke(k)
local stroke = ""
@@ -83,6 +79,12 @@ function keymap.on_key_released(k)
end
if macos then
local keymap_macos = require("core.keymap-macos")
keymap_macos(keymap)
return keymap
end
keymap.add {
["ctrl+shift+p"] = "core:find-command",
["ctrl+p"] = "core:find-file",