In comp.os.linux.x, Peter Billam <
contac...@www.pjb.com.au> wrote:
> Is there some alternative to xterm
> that generates separate escape-codes for the keypad keys ?
You can reprogram the keys at the xterm level. It is a not very well
documented process, and the syntax is odd, but I've done it.
In ~/.Xdefaults, I have this. Note that ! is comment character, not #,
and "#override" is not a comment:
! Scrolling on wheel mouse: half a page normally, line per line with shift,
! page by page with alt.
! use ctrl scroll to shift font sizes, ala Firefox
! Default translastion for shift-insert:
! Shift <KeyPress> Insert:insert-selection(SELECT, CUT_BUFFER0)
! Default translastion for button 2 paste:
! ~Ctrl ~Meta <Btn2Up>:insert-selection(SELECT, CUT_BUFFER0)
! Also add an alternative for ctrl-shift-insert, and shift-button-2
! f1: "$RC\n"
! f2: "#h\n" dumphtml vi macro
! f2: "#M\n" de-base64 vi macro
! shift keypad +: "=" to have = on the keypad
XTerm.vt100.translations: #override \n\
Alt<Btn4Down>,<Btn4Up>:scroll-back(1,page) \n\
Alt<Btn5Down>,<Btn5Up>:scroll-forw(1,page) \n\
<Btn4Down>,<Btn4Up>:scroll-back(1,halfpage) \n\
<Btn5Down>,<Btn5Up>:scroll-forw(1,halfpage) \n\
Shift<Btn4Down>,<Btn4Up>:scroll-back(1,line) \n\
Shift<Btn5Down>,<Btn5Up>:scroll-forw(1,line) \n\
Ctrl<Btn4Down>,<Btn4Up>:larger-vt-font() \n\
Ctrl<Btn5Down>,<Btn5Up>:smaller-vt-font() \n\
Shift~Ctrl<Btn2Up>: insert-selection(CLIPBOARD, CUT_BUFFER1) \n\
Shift<BtnUp>: select-end(CLIPBOARD, CUT_BUFFER1) \n\
Shift Ctrl <KeyPress> Insert: insert-selection(CLIPBOARD, CUT_BUFFER1)\n\
<Key>F1: string("$RC") string(0x0d) \n\
<Key>F2: string("#h") string(0x0d) \n\
<Key>F3: string("#M") string(0x0d) \n\
<Key>F4: string("#J") \n\
Shift <Key>KP_Add: string("=")
All of these need to be set in a single fell swoop, and set before the xterm
starts. The \n\ bit is used to make a multiline statement of it, for
readablity. The last one is relevant for your request. The names of the keys
are from keysymdef.h (on my system it is /usr/include/X11/keysymdef.h) with
the initial XK_ removed. The xterm manpage has an example of using a
keystroke to switch between a default and special application character
mapping. Search for the "keymap(dbx)" example.
> I mean, at the x-event level, the keypad generates different events...
That doesn't sound like xterm level action anymore.
> It's so that yasr could be configured with a kbd-UI like speakup.
I don't understand this.
Elijah
------
X11 is insanely configurable