Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mobily committed Mar 6, 2022
1 parent 3933991 commit 3b91f13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions AwesomeKeys.spoon/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,8 @@ function HyperBindings:setGlobalBindings(...)
hs.fnutils.ieach(
{...},
function(element)
local mods = element.mods or {}
table.insert(self.globals, self:makePrettyKeyLabel(element))
self.hyper:bind(mods, element.key, element.fn)
self.hyper:bind(element.mods or {}, element.key, element.pressFn or element.fn, element.releaseFn)
end
)
end
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,10 @@ hyper:setAppBindings(
label = "", -- optional, a key shortcut label
fn = function()
end,
pressFn = function() -- optional if `fn` is set, a function that will be called when the hotkey has been pressed
end,
releaseFn = function() -- optional, a function that will be called when the hotkey has been released
end
pattern = "" -- (de)activate a shortcut on window title change (internally it uses string.match)
}
}
Expand Down

0 comments on commit 3b91f13

Please sign in to comment.