Keymaster is a simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies. Keymaster has no dependencies and can be used completely standalone. It should not interfere with any JavaScript libraries or frameworks.

Keymaster understands the following modifiers:
⇧, shift, option, ⌥, alt, ctrl, control, command, and ⌘.

The following special keys can be used for shortcuts:
backspace, tab, clear, enter, return, esc, escape, space,
up, down, left, right, home, end, pageup, pagedown, del, delete
and f1 through f19.

When an INPUT, SELECT or TEXTAREA element is focused, Keymaster doesn’t process shortcuts.

Keymaster should work with any browser that fires keyup and keydown events, and is tested with IE (6+), Safari, Firefox and Chrome.

See http://madrobby.github.com/keymaster/ for a live demo. (Look at your firebug console)

https://github.com/madrobby/keymaster

I have recently shifted from KDE4 to Gnome3. In KDE you can create application specific keyboard shortcuts to raise windows. I typically create one each for Firefox, Thunderbird, my terminal etc. That way switching between windows is lightning quick. Gnome doesn’t seem to have that kind of functionality. So I asked on unix stackexchange, if there is a way to achieve the functionality. The clue was to use wmctrl.
Continue reading

While writing a post, I wanted to link a simple tutorial for creating custom keyboard shortcuts in KDE. However I couldn’t find a single tutorial! So here is one:

  1. Hit Alt+F2 (or your custom shortcut for the Run Dialog)
  2. Enter System Settings to start up the tool
  3. Double Click on Shortcuts and Gestures under Application appearance and Behavior
  4. Click on Edit towards the bottom of the screen which opens a popup menu
  5. Navigate to New => Global Shorcut => Command/URL and left click on Command/URL
  6. Change the default name New Action to anything of your choice
  7. Go to the Trigger tab and click on None and press a key combination of your choice
  8. Go to the Action tab and select/enter the path to the script/executable

Pictures speak louder than words..

Bash is so powerful that you can keep digging and finding out newer secrets all the time. We already use bash keyboard bindings – Ctrl d to exit the terminal, Ctrl r for reverse search and so on. Now won’t it be convenient if you could assign keyboard bindings to commands of your choice, to execute them quickly or just to insert lengthy commands which you use repeatedly with subtle changes. Lets look at an example.Continue reading