Bug 213579 - Numeric keypads are ignored when numlock is off
Summary: Numeric keypads are ignored when numlock is off
Status: RESOLVED DUPLICATE of bug 169012
Alias: None
Product: konsole
Classification: Applications
Component: keyboard (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
: 187110 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-11-07 18:33 UTC by Sergei Ivanov
Modified: 2018-03-25 09:35 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Ivanov 2009-11-07 18:33:37 UTC
Version:            (using KDE 4.3.3)
OS:                Linux
Installed from:    Ubuntu Packages

A 104-key PC keyboard has a 'numeric keypad' section that produces digits when NumLock is on, and cursor movement keys (arrows etc) when NumLock is off. This keypad does not work under konsole when NumLock is off - the keys are just ignored (unless you hold a modifier like shift or alt). Tested this on two x86-64 Linux boxes (one is a generic PC desktop and another is a Toshiba laptop).

Expected behavior: when NumLock is off, these keys should produce the same escape sequences as the PC XT cursor movement keys.

Using a recipe found in someone's blog, I fixed this for myself by the patch included below. This is applied to the file 'default.keytab' found in /usr/share/kde4/apps/konsole upon installation.

--- default.keytab      2009-02-18 19:28:38.000000000 +0300
+++ my.keytab   2009-11-01 21:45:08.000000000 +0300
@@ -83,6 +83,27 @@
 #key * +KeyPad+AppKeyPad : "\EOM"
 #key Enter +KeyPad+AppKeyPad : "\r"

+# Keypad keys with NumLock Off
+key Up -Shift+Ansi+AppCuKeys+KeyPad : "\EOA"
+key Down -Shift+Ansi+AppCuKeys+KeyPad : "\EOB"
+key Right -Shift+Ansi+AppCuKeys+KeyPad : "\EOC"
+key Left -Shift+Ansi+AppCuKeys+KeyPad : "\EOD"
+
+key Up -Shift+Ansi-AppCuKeys+KeyPad : "\E[A"
+key Down -Shift+Ansi-AppCuKeys+KeyPad : "\E[B"
+key Right -Shift+Ansi-AppCuKeys+KeyPad : "\E[C"
+key Left -Shift+Ansi-AppCuKeys+KeyPad : "\E[D"
+
+key Home +AppCuKeys+KeyPad : "\EOH"
+key End +AppCuKeys+KeyPad : "\EOF"
+key Home -AppCuKeys+KeyPad : "\E[H"
+key End -AppCuKeys+KeyPad : "\E[F"
+
+key Insert +KeyPad : "\E[2~"
+key Delete +KeyPad : "\E[3~"
+key Prior -Shift+KeyPad : "\E[5~"
+key Next -Shift+KeyPad : "\E[6~"
+
 # other grey PC keys

 key Enter+NewLine : "\r\n"
Comment 1 Robert Knight 2009-11-08 00:24:48 UTC
I added these entries to the default keyboard layout at some point but discovered that it caused problems with Vim.  My notes from the code change were:

Disable application keypad support in the default key bindings file as, although it
produces the correct key codes as tested using 'vttest', it breaks Vim - which
enables application key pad by default.

BUG:183076
CCBUG:170220
Comment 2 Sergei Ivanov 2009-11-08 02:53:39 UTC
(In reply to comment #1)
> I added these entries to the default keyboard layout at some point but
> discovered that it caused problems with Vim.

Those entries were for the case of numlock ON if I understand correctly.
What I added is for numlock OFF, and the codes are the same as for
ordinary arrow keys.

I tried to run vim with my customized keytab file and did not observe
symptoms described in Bug 183076. (However I am not a vi user and cannot
tell vi bugs from features.)
Comment 3 Jekyll Wu 2011-08-13 02:32:26 UTC
*** Bug 189116 has been marked as a duplicate of this bug. ***
Comment 4 Jekyll Wu 2011-08-13 03:14:09 UTC
*** Bug 187110 has been marked as a duplicate of this bug. ***
Comment 5 Ahmad Samir 2018-03-25 09:35:43 UTC

*** This bug has been marked as a duplicate of bug 169012 ***