Emacs and Dvorak
Aug. 23rd, 2005 09:27 pmBasically, the trick involves defining a function that remaps qwerty input into dvorak and then using this to define a minor mode keymap which switches the input:
(defun dvorak-insert () "Translate typed key into Dvorak keyboard." (interactive) (progn (cond ((= last-command-char ?m) (insert "a")) ((= last-command-char ?q) (insert "'")) ((= last-command-char ?w) (insert ",")) ... ))) (define-minor-mode dvorak-mode "Toggle Dvorak keyboard mode." nil " Dvorak" '(("q" . dvorak-insert) ("w" . dvorak-insert) ... ))
And that's pretty much it. The super neat thing about it is that because it's a minor mode, it only applies to current buffer, so there's no need to relearn all the C-M-coke-bottle sequences.