[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: keypad doesn't work in rxvt



That is odd that the terminal isn't "reset" when rxvt starts up. You can get the same
behavior (keypad works) with:

tput reset

    -or-

echo -ne '\033>'

"Ah ha!" you say, so this '\033>' sequence is what does it, but what the hell is
'\033>'? Well, if you look at the Xterm Control Sequences document it sez:

ESC =          Application Keypad (DECPAM)
ESC >          Normal Keypad (DECPNM)

So in fact if you do:

echo -en '\033='

Then your keypad will cease to work again. Cool eh? So why does reset and 'tput reset'
do this? Weeelllll, (as the man page for tput will tell you) doing a 'reset' causes
the rs1, rs2, rs3 and rf terminal control sequences to be written to the terminal. We
use the infocmp program to print out our terminal settings:

chilin$ infocmp | egrep '(rs1|rs2|rs3|rf)='
        rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H,
        rs2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l\E>,

So that's the first thing. Now we're on the trail. When the terminal is 'init'ialized
(as per tput, which must be what happens when rxvt starts up) the terminals is1, is2,
is3, if and iprog strings are output to the terminal (if present). A look again at our
infocmp output shows:

chilin$ infocmp | egrep '(is1|is2|is3|if)='
        ind=^J, is1=\E[?47l\E=\E[?1l,
        is2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l,

You can see that is1 does a '\033=' (\E == Escape == \033). Hmm. I guess if the rxvt
used to work with the keypad before "out of the box" what's happened is that the
debian-dude in charge of terminfo entries changed the entries and that's why the
behavior changed. If you'd like the Xterm Control Sequences doc, I think it comes with
the xbooks package. If you don't want to download the whole (20MB or so) xbooks
package email me and I'll send it to you.

Now, what is going to the keyboard when it's in "Application" mode and you type
<keypad 4>? Well, it's '\033Ot'. Why? I don't know! I can tell you that when I type
the other left-arrow key I get '\033[D' which infocmp happily tells me is the kcub1
(aka kl, or key-left) sequence. Hmmm, curiouser and curiouser. It seems to me that the
keypad 4 should at least generate the key-left sequence if not the 4, right?! I have
no idea why it generates '\033Ot' especially since this doesn't seem to be any
sequence infocmp knows about.

That's all I know.

Later,

scratch wrote:

> Hi,
>
> I have troubles using the keypad in rxvt. I used the .deb file to install
> rxvt, so the setting ought to be the default ones (although i have to
> admit I installed this Debian slink system while keeping my old /home
> partition). Delete & Backspace keys work 'normally' though.
>
> The odd thing is, when I execute do:
>
> intra:~$ reset
> <--- screen cleared --->
> Erase is delete.
> Kill is control-U (^U).
> Interrupt is control-C (^C).
>
> After this, the keypad DOES work. Anyone with a clue as why this happens &
> how I can make the keypad work without "reset"? (For the moment I have it
> in my .profile :))
>
> -- nico
>
> --:: Nico Galoppo ::--------------------------------------------------
> --:: scratch at ace.ulyssis.student.kuleuven.ac.be ::-----------------
>   ::                                               ::
> --:::::::::::::::::::::::::: Linux - Free power for the masses :::::::
>
> --
> Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null

--
Jens B. Jorgensen
jjorgens@bdsinc.com



Reply to: