Created
May 6, 2017 10:04
-
-
Save tomill/7344931c090b618c9cab2a4828123fba to your computer and use it in GitHub Desktop.
"auto alt + yen" watcher #hammerspoon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- based on: http://qiita.com/tanakahisateru/items/d8a67ad89c07baf8c0da | |
local VK_JIS_YEN = 0x5d | |
watcher = hs.eventtap.new({ | |
hs.eventtap.event.types.keyDown | |
}, function(event) | |
local code = event:getKeyCode() | |
-- hs.logger.new('test', 'debug').d(code) | |
if code == VK_JIS_YEN then | |
local flag = event:getFlags() | |
flag['alt'] = not flag['alt'] -- "reverse" alt flag | |
event:setFlags(flag) | |
end | |
end) | |
watcher:start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment