24 lines
563 B
Lua
24 lines
563 B
Lua
-- mod-version:3
|
|
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)
|
|
if PLATFORM == "AmigaOS 4" then
|
|
return k:gsub("right alt", "control")
|
|
:gsub("right amiga", "control")
|
|
elseif PLATFORM == "MorphOS" then
|
|
return k:gsub("right alt", "left ctrl")
|
|
end
|
|
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
|
|
|