Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!ames!bionet!agate!shelby!lindy!drapeau From: drapeau@sioux.Stanford.EDU (George Drapeau) Newsgroups: comp.windows.x Subject: Re: Dvorak keyboard layout for Xmodmap Message-ID: Date: 28 Jun 90 06:17:18 GMT References: <3930013@hpclsv.HP.COM> Sender: root@lindy.Stanford.EDU (Rooter) Organization: Interactive Classroom Experiment, Stanford University Lines: 163 In-reply-to: sundarv@hpclsv.HP.COM's message of 22 Jun 90 18:18:29 GMT In article <3930013@hpclsv.HP.COM> sundarv@hpclsv.HP.COM (Sundar Varadarajan) writes: Does someone have a file that I can feed to xmodmap to get the dvorak keyboard layout on my qwerty keyboard? When I learned the Dvorak layout, I wanted to be able to switch back and forth on an application-by application basis, so that I could have one xterm with a "talk" session going on in Qwerty (which was still more comfortable to me) and another xterm session with the Dvorak typing tutor program. This solution is not solvable through xmodmap (although I think that xmodmap is a cool idea). So, I wrote a translation table. In my opinion, just that I was able to remap my keyboard at the touch of a button from within xterm is proof that the translation tables are an excellent mechanism (Thanks, X-people). Here are two versions, neither of which are completely correct but are certainly good enough for typing. Specifically what's not correct is that control keys retain their normal bindings; in other words, while typing "g" produces an "i", typing Control-g still produces Control-g. I did this because I tend to use control characters by feel rather than by thinking "Press Control-g". To fully convert to Dvorak, I suppose that the Control sequences should also be rebound. The two bindings are for XTerm and for Emacs. Load the first file into the X Resource Database, and maybe put the second file inte your ~/.emacs file. To switch to Dvorak in xterm, press your "F1" key; to switch back to Qwerty, press your "F2" key. In Emacs, to switch to Dvorak, type "M-x Dvorak" (case is important, which probably means you can just type "M-x D" then press return). To switch back to Qwerty, type "M-x Qwerty" ("M-x Q" is probably good enough). If you don't remember your Dvorak, the Dvorak for the word "Qwerty" is "X,dokt" (in other words, if you're looking at the keyboard when you switch back to Qwerty, type "M-x X,dokt"). Okay, enough talk. I hope this helps you some. George --------------- Translation table (plus some other Resources) --------------- *VT100.Translations:#override \ F1: keymap(Dvorak) \n\ F2: keymap(None) *DvorakKeymap.translations:#override\ :Ctrla: string(0x01) \n\ :Ctrlb: string(0x02) \n\ :Ctrlc: string(0x03) \n\ :Ctrld: string(0x04) \n\ :Ctrle: string(0x05) \n\ :Ctrlf: string(0x06) \n\ :Ctrlg: string(0x07) \n\ :Ctrlh: string(0x08) \n\ :Ctrli: string(0x09) \n\ :Ctrlj: string(0x0a) \n\ :Ctrlk: string(0x0b) \n\ :Ctrll: string(0x0c) \n\ :Ctrlm: string(0x0d) \n\ :Ctrln: string(0x0e) \n\ :Ctrlo: string(0x0f) \n\ :Ctrlp: string(0x10) \n\ :Ctrlq: string(0x11) \n\ :Ctrlr: string(0x12) \n\ :Ctrls: string(0x13) \n\ :Ctrlt: string(0x14) \n\ :Ctrlu: string(0x15) \n\ :Ctrlv: string(0x16) \n\ :Ctrlw: string(0x17) \n\ :Ctrlx: string(0x18) \n\ :Ctrly: string(0x19) \n\ :Ctrlz: string(0x1a) \n\ :a: string(a) \n\ :b: string(x) \n\ :c: string(j) \n\ :d: string(e) \n\ :e: string(".") \n\ :f: string(u) \n\ :g: string(i) \n\ :h: string(d) \n\ :i: string(c) \n\ :j: string(h) \n\ :k: string(t) \n\ :l: string(n) \n\ :m: string(m) \n\ :n: string(b) \n\ :o: string(r) \n\ :p: string(l) \n\ :q: string("'") \n\ :r: string(p) \n\ :s: string(o) \n\ :t: string(y) \n\ :u: string(g) \n\ :v: string(k) \n\ :w: string(",") \n\ :x: string(q) \n\ :y: string(f) \n\ :z: string(";") \n\ :minus: string("`") \n\ :semicolon: string(s) \n\ :grave: string("/") \n\ :apostrophe: string("-") \n\ :comma: string(w) \n\ :period: string(v) \n\ :slash: string(z) \n\ :quotedbl: string("_") \n\ :underscore: string("~") \n\ :asciitilde: string("?") \n\ :A: string(A) \n\ :B: string(X) \n\ :C: string(J) \n\ :D: string(E) \n\ :E: string(">") \n\ :F: string(U) \n\ :G: string(I) \n\ :H: string(D) \n\ :I: string(C) \n\ :J: string(H) \n\ :K: string(T) \n\ :L: string(N) \n\ :M: string(M) \n\ :N: string(B) \n\ :O: string(R) \n\ :P: string(L) \n\ :Q: string(0x22) \n\ :R: string(P) \n\ :S: string(O) \n\ :T: string(Y) \n\ :U: string(G) \n\ :V: string(K) \n\ :W: string("<") \n\ :X: string(Q) \n\ :Y: string(F) \n\ :Z: string(":") \n\ :less: string(W) \n\ :greater: string(V) \n\ :question: string(Z) \n\ :colon: string(S) ---------------------- Put this in your .emacs file ---------------------- (defun Dvorak () "Written by George Drapeau, uses a translation table that turns your keyboard into a Dvorak keyboard. Try it, you'll like it." (interactive) (setq keyboard-translate-table "\C-@\C-a\C-b\C-c\C-d\C-e\C-f\C-g\C-h\C-i\C-j\C-k\C-l\C-m\C-n\C-o\C-p\C-q\C-r\C-s\C-t\C-u\C-v\C-w\C-x\C-y\C-z\033\034\035\036\037 !_#$%&-()*+w`vz0123456789SsW=VZ@AXJE>UIDCHTNMBRL\"POYGK