Skip to content

Commit

Permalink
Add hs.hotkey.bindSpec()
Browse files Browse the repository at this point in the history
  • Loading branch information
cmsj committed Apr 26, 2017
1 parent 1a283aa commit 404848c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions extensions/hotkey/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,25 @@ function hotkey.bind(...)
return hotkey.new(...):enable()
end

--- hs.hotkey.bindSpec(keyspec, ...) -> hs.hotkey object
--- Constructor
--- Creates a hotkey and enables it immediately
---
--- Parameters:
--- * keyspec - A table containing two items:
--- * first, a table containing keyboard modifiers, as specified in `hs.hotkey.bind()`
--- * second, a string containing the name of a keyboard key, as specified in `hs.hotkey.bind()`
--- * ... - All remaining arguments are as specified in `hs.hotkey.bind()`
---
--- Returns:
--- * A new `hs.hotkey` object for method chaining
---
--- Notes:
--- * This function is just a wrapper that performs `hs.hotkey.bind(keyspec[1], keyspec[2], ...)`
function hotkey.bindSpec(keyspec, ...)
return hotkey.bind(keyspec[1], keyspec[2], ...)
end

--- === hs.hotkey.modal ===
---
--- Create/manage modal keyboard shortcut environments
Expand Down

0 comments on commit 404848c

Please sign in to comment.