Skip to content

Instantly share code, notes, and snippets.

View ashfinal's full-sized avatar

ashfinal ashfinal

View GitHub Profile
@ashfinal
ashfinal / catch_fn.lua
Created June 3, 2017 07:53 — forked from zzamboni/catch_fn.lua
How to catch the fn key using Hammerspoon
-- Catch fn-h and convert it to a left arrow key.
function catcher(event)
if event:getFlags()['fn'] and event:getCharacters() == "h" then
print("fn-h!")
return true, {hs.eventtap.event.newKeyEvent({}, "left", true)}
end
return false
end
local tapper=hs.eventtap.new({hs.eventtap.event.types.keyDown}, catcher):start()