Keymando is a powerful, all-purpose tool that allows for open-ended customization. Here are a few of the basics to help you get started.
Keymando’s configuration is simply stored in a file called
keymandorc.rb, following the popular ‘rc’ convention. All the following examples can be put directly into this file.
You can find where your keymandorc.rb file is stored by going to Setup in the Keymando menu.
The default location is:
You can also quickly edit your
keymandorc.rb file by going to the Edit Config in the Keymando menu. This will open your config file with your default ruby file editor.
Two other important settings are the Keymando directory and the Plugins directory. The Keymando directory is a location where any additional files can be evaluated, similary to your
keymandorc.rb. This allows your to break your configuration into multiple files. The default Keymando directory is here:
The Plugins directory is where plugins are loaded from. The default location is
Key mapping allows you to map key(s) to other key(s) or to actions.
Vim users will appreciate this example.
map "<Ctrl-[>", "<Escape>"
You can also map keys to
nil to effectively disable a key or keys. This is useful for preventing unwanted quitting of applications.
only /iTerm/ do map "<Cmd-w>", nil map "<Cmd-q>", nil map "<Cmd-r>", nil map "<Cmd-t>", nil end
In order for changes to take affect, the
keymandorc.rb must be reloaded. This can be accomplished via the Reload Config menu item or the
map '<Ctrl-r>' do alert('Reloaded Successfully') if reload end
As we saw in the previous example, Keymando’s key mapping allows you to specify filters with
except. These filters take a list of strings and/or regular expressions to match the currently active application.
except /iTerm/, "MacVim" do map "<Ctrl-j>", "<Down>" map "<Ctrl-k>", "<Up>" map "<Ctrl-h>", "<Left>" map "<Ctrl-l>", "<Right>" end
only /Outlook/ do nmap "#", "<Delete>" nmap "c", "<Cmd-n>" nmap "y" do send("<Cmd-Shift-m>") send("Archive<Enter>") end nmap "v" do send("<Cmd-Shift-m>") end end
nmap specifies a ‘normal’ mode key mapping, that is, not in a textbox.
imap specifies an ‘insert’ mode key mapping, that is, inside a textbox.
Keymando features reusable units of execution called commands and comes with many included by default. Commands like “Show Current App Menus”, “Lock the Screen”, and “Window - Move to Fullscreen”.
The easiest way to use commands is to map a key combination to
Think of an application launcher for commands.
map "<Cmd- >", Commands.run_registered_command
Another good key mapping to have is the
map "<Cmd-.>", Commands.run_last_command
You can also “register” commands apart from key mappings.
command "Quit current application" do send("<Cmd-q>") end command "Volume Up" do `osascript -e 'set volume output volume (output volume of (get volume settings) + 7)'` end command "Volume Down" do `osascript -e 'set volume output volume (output volume of (get volume settings) - 7)'` end
Creating a command this will make is available in the
You can access and run commands in your scripts via the follow convention.
Keymando comes with window manipulation commands out of the box.
Here are just a few:
Window - Move to Full Screen Window - Move to Top Left Window - Move to Top Left Window - Bump Left by 5
See Commands for the basic on how to use commands.
right_click left_click double_click
If you’d like more in-depth documentation, check out the latest build’s documention.