key Shift+Prior not working for scroll-up in xterm but in urxvt

Thomas Dickey dickey at his.com
Fri Feb 6 09:33:46 UTC 2015


On Fri, Feb 06, 2015 at 09:15:25AM +0100, Matthias Apitz wrote:
> 
> Hello,
> 
> This question is within -HEAD and ports as well from -HEAD:
> 
> $ pkg info | egrep 'xorg-7|xterm|rxvt'
> rxvt-unicode-9.20              Clone of the terminal emulator rxvt modified to support Unicode
> xorg-7.7_1                     X.Org complete distribution metaport
> xterm-312                      Terminal emulator for the X Window System
> 
> I run this 11C on a small netbook (Acer C720) which does not have physical
> keys for PG_UP/DOWN; that's why I use xmodmap to define 
> 
> Mode_switch + UP --> Prior
> Mdee_switch + Down --> Next
> 
> xmodmap -e "keycode 98  =  Up   Up   Prior"
> xmodmap -e "keycode 104 =  Down Down Next"
> 
> When I now do in the terminal urxvt holding down both Mode_switch and
> Shift, it scrolls fine with the Up and Down keys as expected: the
> terminal window is scrolled up and down.
> 
> When I do the same, the key is delivered to the xterm itself and I can
> see them, for example, with 'od -c' as:
> 
> $ od -c
> ^[[5;2~^[[5;2~
> ^[[6;2~^[[6;2~
> 0000000  033   [   5   ;   2   ~ 033   [   5   ;   2   ~  \n 033   [   6
> 0000020    ;   2   ~ 033   [   6   ;   2   ~  \n                        
> 0000032
> 
> The 033 [ 5 ; 2 ~ for Up and the 033 [ 6 ; 2 ~ for down.
> 
> Why this does not work in xterm?

That depends on what you want it to do (you did not say).

xterm differs from urxvt in this area, as noted in their respective manpages.
It uses the X Toolkit to translate keycodes with their modifiers into key
symbols.  In the manpage, it shows this in the default translations resource
(which is likely relevant):

                     Shift <KeyPress> Prior:scroll-back(1,halfpage) \n\
                      Shift <KeyPress> Next:scroll-forw(1,halfpage) \n\

Small keyboards such as used on laptops may eliminate or recombine keys
in ways that make it awkward to type shift-pageup.  You can (almost)
always work around those by configuring a customized translations
resource in your X settings.  (rxvt/urxvt also has a way to work around
these problems, but is far less generalized).

-- 
Thomas E. Dickey <dickey at invisible-island.net>
http://invisible-island.net
ftp://invisible-island.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20150206/5794930e/attachment.sig>


More information about the freebsd-questions mailing list