aboutsummaryrefslogtreecommitdiff
path: root/plugins/macmodkeys.lua
blob: d8c0d05cd2e9f4aa3980435aa25a96ec30ccdcf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- mod-version:2 -- lite-xl 2.0
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