xterm key remapping

James Helman jim at baroque.Stanford.EDU
Tue Sep 18 05:58:37 AEST 1990


X keyboard bindings can be changed globally using xmodmap, e.g.  the
following binds the caps lock key to <CTL> and changes the backspace
key to <DEL>.  (Which is after all, where they were before
international keyboards forced finger dances such as the Control
Stretch Twist or Control Two Hand Boogie upon us.)

	xmodmap - << xxx
	clear lock
	add control = Caps_Lock
	keycode 66 = Delete Delete
	xxx

xmodmap -pk prints out the keyboard table.

If you want to change particular keys under xterm, change mouse button
actions or bind function keys to strings, you can modify xterm's
resources to create your own keymaps.  The following lines in a
.Xdefaults file or used as input to xrdb will create special keymaps
for the function keys.

XTerm*VT100.Translations: #override \
	    <Key>F1:		string("ls -atl") string(0x0d) \n\
	    <Key>F2:		string("ls -alt | head") string(0x0d) \n\
	    <Key>F10:		keymap(mh) \n\
	    <Key>F11:		keymap(dbx) \n\
	    <Key>F12:		keymap(None) \n\

XTerm*VT100.mhKeymap.translations: \
             <Key>F1: string("prev") string(0x0d) \n\
             <Key>F2: string("comp") string(0x0d) \n\
             <Key>F3: string("show") string(0x0d) \n\
             <Key>F4: string("repl") string(0x0d) \n\
             <Key>F5: string("next") string(0x0d) \n\
             <Key>F6: string("forw") string(0x0d) \n\
             <Key>F7: string("scan last:10") string(0x0d) \n\
             <Key>F8: string("rmm") string(0x0d)

XTerm*VT100.dbxKeymap.translations: \
             <Key>F1: string("next") string(0x0d) \n\
             <Key>F2: string("step") string(0x0d) \n\
             <Key>F3: string("continue") string(0x0d) \n\
             <Key>F4: string("print ") insert-selection(PRIMARY, CUT_BUFFER0)\n\
             <Key>F5: string("stop at ") insert-selection(PRIMARY, CUT_BUFFER0)\n\
             <Key>F6: string("up") string(0x0d) \n\
             <Key>F7: string("down") string(0x0d) \n\
             <Key>F8: string("status") string(0x0d)


Jim Helman
Department of Applied Physics			Durand 012
Stanford University				FAX: (415) 725-3377
(jim at KAOS.stanford.edu) 			Work: (415) 723-9127



More information about the Comp.sys.sgi mailing list