Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Alternative to xterm, with separate keypad

17 views
Skip to first unread message

Peter Billam

unread,
Apr 18, 2013, 4:43:26 AM4/18/13
to
Hi :-)

Is there some alternative to xterm
that generates separate escape-codes for the keypad keys ?

I mean, at the x-event level, the keypad generates different events...

It's so that yasr could be configured with a kbd-UI like speakup.

Regards, Peter

--
Peter Billam www.pjb.com.au www.pjb.com.au/comp/contact.html

Eli the Bearded

unread,
Apr 18, 2013, 3:12:10 PM4/18/13
to
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

Peter Billam

unread,
Apr 18, 2013, 7:05:18 PM4/18/13
to
On 2013-04-18, Eli the Bearded <*@eli.users.panix.com> wrote:
> 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:
> ...
> Shift <Key>KP_Add: string("=")
> ... 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.

Ooh... yes, promising :-) I'll see if I can get that working...

> > It's so that yasr could be configured with a kbd-UI like speakup.
> I don't understand this.

They're both screen-readers, for the blind or visually impaired, eg:
http://www.pjb.com.au/blin/index.html#scr
which documents (visually :-) speakup's keypad-driven functions.

In:
http://search.cpan.org/~pjb/Speech-Speakup-1.02/Speakup.pm#DESCRIPTION
it says:
Speakup is a screen-reader that runs on Linux as a module within the
kernel. A screen-reader allows blind or visually-impaired people to
hear text as it appears on the screen, and to review text already
displayed anywhere on the screen. Speakup will only run on the linux
consoles, but is powerful and ergonomic, and can run during the
boot process. The other important screen-reader is yasr, which
runs in user-space and is very portable, but has less features.

The difference in power-of-use and ergonomy (?) is that speakup
uses the keypad keys for its screen-reading commands. But yasr is
highly configurable, and if the keypad could generate distinctive
escape-sequences yasr could be configured to a largely-compatible
kbd-UI, which would be nice for people who have learned speakup,
or for people who still have enough sight to use X, but would
like to start training themselves in the speakup kbd-UI.

Thanks for your help,

Eli the Bearded

unread,
Apr 18, 2013, 7:25:41 PM4/18/13
to
In comp.os.linux.x, Peter Billam <contac...@www.pjb.com.au> wrote:
> On 2013-04-18, Eli the Bearded <*@eli.users.panix.com> wrote:
> > character mapping. Search for the "keymap(dbx)" example.
> Ooh... yes, promising :-) I'll see if I can get that working...

I'm not great with it, but I'll gladly help review if you get stuck.
Caps lock can easily be used as a modifier, but I'm not sure if Insert
can be. You could use xmodmap to make Insert into another caps lock,
though. The hit-twice commands might not be mappable.

> > > It's so that yasr could be configured with a kbd-UI like speakup.
> > I don't understand this.
> They're both screen-readers, for the blind or visually impaired, eg:

Got it. Orca was the only linux screen reader I knew by name.

> http://www.pjb.com.au/blin/index.html#scr
> which documents (visually :-) speakup's keypad-driven functions.

Your text layout style alone suggests that you are not relying solely
on screen readers to work.

Elijah
------
blind users don't care a lot about indents or line length
0 new messages