We have modified the keyboard layout from the viewpoint of Emacs commands. The new layout permits us an easy control for Emacs. So far, so good. But how about typing normal English text? It is not as easy as typing Emacs commands; not better than normal QWERTY keyboard, at best.
Then what keyboard layout should a lazy man use to type English text? The answer is DVORAK, because it requires much less finger movement compared to QWERTY. OK, let's use it.
But how can we implement it on Emacs? Fortunately, XKB can assign, say, 'a', 'A', 'C-b' and 'M-b' to a single key. Thanks to this functionality, we can implement the DVORAK layout shown below when neither Control nor Meta is held down.
With this configuration, the key under your right index finger's home position (whose keytop is 'J'), for example, works like this:
| modifier | input |
|---|---|
| none | h |
| shift | H |
| control | C-n |
| meta | M-n |
The following table shows the correspondence among symbols on the keytops (QWERTY), inputs without modifier or only with shift (DVORAK) and inputs with other modifiers (MODIFY):
| QWERTY | DVORAK | MODIFY |
|---|---|---|
| q | ' | ' |
| w | , | , |
| e | . | . |
| r | p | o |
| t | y | t |
| y | f | a |
| u | g | d |
| i | c | g |
| o | r | e |
| p | l | l |
| a | a | r |
| s | o | s |
| d | e | z |
| f | u | u |
| g | i | i |
| h | d | b |
| j | h | n |
| k | t | p |
| l | n | f |
| ; | s | k |
| z | ; | ; |
| x | q | q |
| c | j | j |
| v | k | c |
| b | x | x |
| n | b | h |
| m | m | m |
| , | w | w |
| . | v | v |
| / | z | y |
The following procedure realises the customisation described so far.
-d------ -------- ntakahas(kinesis)
-dp----- -------- ntakahas(default)
Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbKeycodes" "xfree86"
Option "XkbTypes" "basic+ntakahas"
Option "XkbCompat" "basic+misc+xfree86"
Option "XkbSymbols" "ntakahas"
Option "XkbGeometry" "kinesis(model100)"
EndSection
We also need to modify Emacs itself. Apply this patch to the file src/xterm.c of GNU Emacs-21.4a and recompile.
This is the end of level 2 keyboard customisation.