A project to create application specific keyboard shortcut bindings.
Install Hammerspoon automation software for OS X
Clone this repository (preferably into ~/.hammerspoon)
- Create bindings for a specific piece of hardware (available keys and modifiers will depend on hardware)
- Create a map of keys to modifiers to callbacks with the following structure
{
key1= {
{modifierA, modifierB, ...}= callback_a,
...
},
...
}- Each callback should have the signature: function(key, modifierSet)
- pass the map to the binder/mapBinder.bind method
- Create a map of keys to modifiers to callbacks with the following structure
- If application specific bindings are required
- Create a hardware binder object the performs the described steps above in its
bind
method- binder/G600binder is an example of a hardware binder for a Logiteck G600 which binds the same function to each key+modifier combination (used for application specific binding)
- Create a map of key+modifiers to callbacks for each application with the following structure
{
"modifierA_modifierB_..._key"= callback_a,
...
}- modifiers should be in ascending order
- appBindMaps/intellij_idea is an example of such a map
- combine all maps into a single table where each key is the name of the application
- pass the hardware binder and the set of application bindings to binder/appBinder.bind
- optionally provide map of default bindings as a third argument
- an example of this, using the G600binder and maps for chrome, intellij, ... is shown in the init file
- Create a hardware binder object the performs the described steps above in its
This project is licensed under the MIT License - see the LICENSE.md file for details