I am writing here in case there is a solution I missed. The provided configuration works as described, but my problem is that it is slow, or rather, it isn't as responsive as it used to be under with the original Karabiner.
-- A global variable for the Hyper Mode
k = hs.hotkey.modal.new({}, "F17")
passthrough = function(key)
-- hs.alert.show("Config loaded: " .. key)
k.triggered = true
hs.eventtap.keyStroke({"cmd","alt","shift","ctrl"}, key)
end
k:bind({}, 'c', nil, function() passthrough('c') end)
k:bind({}, 'f', nil, function() passthrough('f') end)
k:bind({}, 'e', nil, function() passthrough('e') end)
k:bind({}, 'p', nil, function() passthrough('p') end)
k:bind({}, '1', nil, function() passthrough('1') end)
k:bind({}, '2', nil, function() passthrough('2') end)
k:bind({}, '3', nil, function() passthrough('3') end)
k:bind({}, '4', nil, function() passthrough('4') end)
k:bind({}, '5', nil, function() passthrough('5') end)
k:bind({}, '6', nil, function() passthrough('6') end)
k:bind({}, '7', nil, function() passthrough('7') end)
k:bind({}, 'left', nil, function() passthrough('left') end)
k:bind({}, 'right', nil, function() passthrough('right') end)
k:bind({}, 'down', nil, function() passthrough('down') end)
k:bind({}, 'up', nil, function() passthrough('up') end)
k:bind({}, 'pagedown', nil, function() passthrough('pagedown') end)
k:bind({}, 'pageup', nil, function() passthrough('pageup') end)
k:bind({}, 'space', nil, function() passthrough('space') end)
ofun = function()
hs.alert.show("Config loaded")
hs.reload()
k.triggered = true
end
k:bind({}, 'o', nil, ofun)
-- Enter Hyper Mode when F18 (Hyper/Capslock) is pressed
pressedF18 = function()
k:enter()
k.triggered = false
end
-- Leave Hyper Mode when F18 (Hyper/Capslock) is pressed
releasedF18 = function()
k:exit()
if not k.triggered then
hs.eventtap.keyStroke({}, 'F19')
end
end
-- Bind the Hyper key
hs.hotkey.bind({}, 'F18', pressedF18, releasedF18)