Created
August 31, 2018 14:12
-
-
Save rderik/e677cad4ad1e27258af61a28ea397cd6 to your computer and use it in GitHub Desktop.
testing hammerspoon
This file contains hidden or 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
function dealWithKeys(evt) | |
curr_modifiers = evt:getFlags() | |
print(curr_modifiers["ctrl"]) | |
print("========================") | |
mod_table = { ["ctrl"] = true } | |
print(mod_table['ctrl']) | |
if (curr_modifiers.contain({ "ctrl" })) then | |
print "Only has Control" | |
else | |
print "Might have something else" | |
end | |
for k,v in pairs(curr_modifiers) do | |
print("Key:") | |
print(k) | |
print("Value:") | |
print(v) | |
end | |
print("Dealt with") | |
end | |
tapping_code = hs.eventtap.new({hs.eventtap.event.types.flagsChanged},dealWithKeys) | |
tapping_code:start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment