In xterm the numpad 1 and 7 buttons does not work properly

0

I use VNC, open an xterm, and for example when I press "NumPad7", it completes "Home" command. Also "NumPad1" is mapped to "End". How to fix this?

In fact there is a code for .cshrc that does the work required. But unfortunately I can't translate it into a bash code. Please help me to translate. Here is the code:

if ($?TERM) then
    # fix the home, end, ins and del keys
    if ($TERM == "xterm" || $TERM == "vt100" || \
        $TERM == "vt102" || $TERM !~ "con*") then
        # bind keypad keys for xterm, vt100, vt102, console
        bindkey "\e[1~" beginning-of-line  # Home
        bindkey "\e[7~" beginning-of-line  # Home rxvt
        bindkey "\e[2~" overwrite-mode     # Ins
        bindkey "\e[3~" delete-char        # Delete
        bindkey "\e[4~" end-of-line        # End
        bindkey "\e[8~" end-of-line        # End rxvt
    endif
endif

Narek

Posted 2011-02-17T17:04:41.463

Reputation: 1 251

Answers

0

You can try numlockx. It can set or toggle the state of numlock from the command line. To turn on numlock:

numlockx on

Now when you press NumPad7, for example, you'll get a 7.

It's available in these popular formats as well as at the link above:

Paused until further notice.

Posted 2011-02-17T17:04:41.463

Reputation: 86 075

Could you please be more specific? – Narek – 2011-02-20T08:18:15.837

@Narek: Please see my edited answer. – Paused until further notice. – 2011-02-20T14:43:57.857

No, the problem is that my numpad is ON, and the other numbers work correctly. Only 1 and 7 do not work. – Narek – 2011-02-20T15:08:02.057

@Narek: That's really weird. Try running xev and see if the output looks right. Check to see if something strange has been set using xmodmap. – Paused until further notice. – 2011-02-20T15:36:38.623