Emacs + Keyboard Geeking, the Nth Episode 2012-03

Perm URL with updates: http://xahlee.org/kbd/keyboard_geeking_2012-03-27.html

Just spent ~4 hours and did major surgery on my keyboard system again.

specifically, the change is this:

Before, the 【Menu+‹key›】 combo insert various Unicode chars, and Caps Lock does emacs's “execute-extended-command” (M-x). Now, the two are switched. Now the Menu key does “execute-extended-command” (just like on Linux by default), and 【Caps Lock ‹key›】 inserts Unicode chars (note it's a key sequence here, not combo.).

Also, Esc now does emacs's cancel 【Ctrl+g】.

The mappings are done using AutoHotkey and emacs. Here's related references and tutorials:

Note that all my {F1, …, F12} function keys are used up. All 15/17 keys on the numberpad are also used up (the exceptions are Num Lock and Enter). All 9 app launch special buttons on the keyboard are also used up. Some of these keys are used globally, some are app specific. If you have empty function keys, you should make use of it NOW! (➲ Increase Productivity Using F1 … F12 Keys)

here's a summery of my keyboard shortcut design principle.

  • ① the most fundamental principle: always bind the most frequently used operation to the easiest key (Frequency must be determined by statical means, as much as possible. (habit clouds your judgement) (➲ Emacs's Command Frequency)). Over the years, i find that this principle out weight any other, by far. This is the single most important principle.
  • ② key-combinations (i.e. hold a modifier key and press another), should be completely abolished.

wrote much about this already here: Keyboard Shortcut Design: Dedicated keys, Special Buttons, Extra Keys.

for some reason, i've always loved keys, and efficiency. Got a Brother electric typewriter in ~1986. (First computer use is ~1990. My first computer is ~1991.) Was QWERTY typist. Switched to Dvorak ~1993. Wrote my own Dvorak layout for Mac OS using ResEdit, ~1993. Use QuicKeys from ~1992 to 2002, and had IJKL keys as cursor movement. First emacs use ~1998. Live in emacs starting 1999. From 1999 to 2005, i use default emacs keys, and use emacs in text terminals exclusively. Have always explored all keyboard shortcuts in every OS/App i've used. ErgoEmacs keybinding started in 2007. Starting in 2007, i got really heavy with keybinding design and spend hours every month, studying, thinking, researching, tweaking, keys. LOL. The experience is sometimes frustrating, because the keyboard itself is so badly designed (➲ Keyboard Hardware Design Flaws), and then ALL the keyboard tools, counting emacs and {Windows, Mac, Linux}, all have quirks that doesn't let you do certain bindings. So, when thinking about optimal key placement, you have to consider lots aspects. (preferrably, you want your bindings to work on all OSes, and on all keyboards (e.g. some don't have Menu key or RWin key, then there's Difference Between Apple and PC keyboards.), and also generally compatible with existing conventions, minimize using advanced features of keymacro utils (because some key combo won't work in another OS).), and then muscle memory change is a pain. So far, i haven't explored much of Linux's keyboard system. Did spent a month on linux last year. The keyboarding issues there isn't roses.

Here's 2 lines i added to my AutoHotkey:

#IfWinActive ahk_class Emacs

CapsLock::Send ^2 ; call Ctrl+2
Esc::Send ^g ; call C-g

The 【Ctrl+2】 in MY emacs customization is a prefix to commands that insert unicode. See: xah_emacs_unicode_input.el.

What Keyboard You Use and How Much You Type, Really?

Note: when we talk about keybinding, keyboarding habit, etc, it's important to say what keyboard one actually use, and how much one really types (from stat of a keylog). Otherwise, there's a lot miscommunication in online forums. One person says X, another can't see how X would be good, and it turns out one is using laptop keyboard and another fancy Kinesis, etc.

Also of interest is how much one really types. We often hear “I sit on computer 10 hours a day for n years, and i think the keybinding/keyboard should be this or that way”. We coders all sit in front of comp all day. I did a calculation from my keylog last year to see how much i really typed. I was surprised to find that i actually type only 17k keystrokes a day, and that's only about 70 minutes per day if we use 50 wpm. See: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?.

The keyboard i currently use is Microsoft Natural Multimedia keyboard.

Popular posts from this blog

Browser User Agent Strings 2012

11 Years of Writing About Emacs

does md5 creates more randomness?