diff options
author | rxi <rxi@users.noreply.github.com> | 2019-12-28 11:36:13 +0000 |
---|---|---|
committer | rxi <rxi@users.noreply.github.com> | 2019-12-28 11:36:13 +0000 |
commit | 8156f538cdf577a0163759a6c8484891a2e29c25 (patch) | |
tree | c7c2825cb669fb8e1d32a382c125f2d9fd60e12f /macmodkeys.lua | |
download | lite-xl-plugins-8156f538cdf577a0163759a6c8484891a2e29c25.tar.gz lite-xl-plugins-8156f538cdf577a0163759a6c8484891a2e29c25.zip |
Initial commit
Diffstat (limited to 'macmodkeys.lua')
-rw-r--r-- | macmodkeys.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/macmodkeys.lua b/macmodkeys.lua new file mode 100644 index 0000000..69028ab --- /dev/null +++ b/macmodkeys.lua @@ -0,0 +1,18 @@ +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 + |