honeylisp/vendor/lite-plugins/plugins/macmodkeys.lua
Jeremy Penner cb5132f393 git subrepo clone https://github.com/rxi/lite-plugins vendor/lite-plugins
subrepo:
  subdir:   "vendor/lite-plugins"
  merged:   "de4227d"
upstream:
  origin:   "https://github.com/rxi/lite-plugins"
  branch:   "master"
  commit:   "de4227d"
git-subrepo:
  version:  "0.4.2"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "65fde50"
2020-11-19 21:04:39 -05:00

19 lines
389 B
Lua

local keymap = require "core.keymap"
local on_key_pressed = keymap.on_key_pressed
local on_key_released = keymap.on_key_released
local function remap_key(k)
return k:gsub("command", "ctrl")
:gsub("option", "alt")
end
function keymap.on_key_pressed(k)
return on_key_pressed(remap_key(k))
end
function keymap.on_key_released(k)
return on_key_released(remap_key(k))
end