Changes:
        + correct xterm+keypad keys when in non-sunKeyboard mode
        + modify xterm+keypad and add xterm+keypad+noent to serve as a common
          key set for other terminals; add xterm+keypad+all and
          xterm+keypad+novt for full-featured xterm and fix xterm-vt220

Signed-off-by: Jakub Horký <[email protected]>
---
 misc/terminfo.src | 55 +++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 46 insertions(+), 9 deletions(-)

diff --git a/misc/terminfo.src b/misc/terminfo.src
index 8b462d94..18549507 100644
--- a/misc/terminfo.src
+++ b/misc/terminfo.src
@@ -5052,7 +5052,7 @@ xterm+nofkeys|building block for xterm fkey-variants,
        kcbt=\E[Z, nel=\EE, use=ecma+index, use=ansi+rep,
        use=ecma+strikeout, use=vt420+lrmm, use=xterm+focus,
        use=xterm+sm+1006, use=xterm+tmux, use=ecma+italics,
-       use=xterm+keypad, use=xterm-basic,
+       use=xterm+keypad+novt, use=xterm-basic,
 
 xterm-p370|xterm patch #370,
        rv=\E\\[>41;[1-6][0-9][0-9];0c,
@@ -5290,7 +5290,8 @@ xterm+alt+title|xterm 90 and 251 features combined,
 # directly related to VT100.
 #
 # With the VT220 keypad block that uses the 1-9 keys as suggested in
-# terminfo(5), the other keys can be handled with user-defined capabilities:
+# terminfo(5), the other keys can be handled with user-defined capabilities.
+# This applies to xterm in Sun/PC to VT220 emulation (sunKeyboard) mode:
 #
 #   ______________________________________
 #  | NumLock |    /    |    *    |    -    |
@@ -5315,15 +5316,47 @@ xterm+alt+title|xterm 90 and 251 features combined,
 # kpCMA (comma) is used here for the VT100 keypad, which xterm emulates with
 # shifted-keypad-plus, though normally that invokes a font-size change.
 #
+# This layout applies to xterm in normal PC-Style (non-sunKeyboad) mode:
+#   ______________________________________
+#  | NumLock |    /    |    *    |    -    |
+#  |         |   $Oo   |   $Oj   |   $Om   |
+#  |_________|__kpDIV__|__kpMUL__|__kpSUB__|
+#  |    7    |    8    |    9    |    +    |
+#  | ~ Home  | ~ Up    | ~ PgUp  |   $Ok   |
+#  |_________|_________|_________|  kpADD  |
+#  |    4    |    5    |    6    |         |
+#  | ~ Left  |   $[E   | ~ Right |         |
+#  |_________|_kbeg_@1_|_________|_________|
+#  |    1    |    2    |    3    |         |
+#  | ~ End   | ~ Down  | ~ PgDn  |         |
+#  |_________|_________|_________| ~ Return|
+#  |         0         |    .    |         |
+#  |       ~ Ins       | ~ Del   |         |
+#  |___________________|_________|_________|
+#
+# Keys prefixed with ~ mean that it produces respective non-keypad key.
+#
+# Key 5 produces $OE instead of $[E in Application Cursor Mode, which is
+# currently undocumented behavior.
+#
 # Old versions of xterm, e.g., xterm-xfree86, documented \EOE as kb2, which
 # does not fit into this layout.  The extension kp5 fits, but is not visible
 # to termcap applications.  As an alternative, kbeg (which does have a termcap
 # equivalent) is provided.
 #
-xterm+keypad|xterm emulating VT100/VT220 numeric keypad,
-       kbeg=\EOE, kp5=\EOE, kpADD=\EOk, kpCMA=\EOl, kpDIV=\EOo,
-       kpDOT=\EOn, kpMUL=\EOj, kpSUB=\EOm, kpZRO=\EOp,
-       use=vt220+keypad,
+xterm+keypad+noent|xterm numeric keypad keys (common w/o kent),
+       kpADD=\EOk, kpDIV=\EOo, kpMUL=\EOj, kbeg=\EOE, kp5=\EOE,
+       use=vt100+keypad,
+#
+xterm+keypad|xterm numeric keypad keys (common),
+       kent=\EOM, use=xterm+keypad+noent,
+#
+xterm+keypad+all|xterm numeric keypad keys (all),
+       kpSPC=\EO\s, kpTAB=\EOI, kpEQU=\EOX, use=xterm+keypad,
+#
+xterm+keypad+novt|xterm numeric keypad in all keyboard modes but Sun/PC (-sp),
+       @ka2, @kb1, @kb3, @kc2, @kpDOT, @kpZRO, @ka1, @kb2, @ka3, @kc1, @kc3,
+       use=xterm+keypad+all,
 #
 # Those chunks use the new-style (the xterm oldFunctionKeys resource is false).
 # Alternatively, the same scheme with old-style function keys as in xterm-r6
@@ -5706,14 +5739,14 @@ xterm-sco|xterm with SCO function keys,
 #      + maps numeric keypad "+" to ",".
 #      + uses DEC-style control sequences for the application keypad.
 #
-xterm-vt220|xterm emulating VT220,
+xterm-vt220|xterm emulating VT220 keyboard,
        npc,
        kcbt=\E[Z, kend=\E[4~, khome=\E[1~, kmous=\E[M, nel=\EE,
-       use=xterm+app, use=xterm+edit, use=vt220+keypad,
+       use=xterm+app, use=xterm+edit, kpADD@, use=xterm+keypad+all,
        use=ecma+italics, use=ecma+index, use=ansi+rep,
        use=ecma+strikeout, use=vt220+sfkeys,
        use=xterm+r5+fkeys, use=xterm+focus, use=xterm+sm+1006,
-       use=xterm+tmux, use=xterm+keypad, use=xterm-basic,
+       use=xterm+tmux, use=xterm-basic,
 
 xterm-vt52|xterm emulating DEC VT52,
        acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
@@ -27993,6 +28026,10 @@ v3220|LANPAR Vision II model 3220/3221/3222,
 #        since they don't support application keypad mode
 #      + add full VT100 keypad support to wy85-8bit and tek4105-30, as they
 #        support application keypad mode
+#      + correct xterm+keypad keys when in non-sunKeyboard mode
+#      + modify xterm+keypad and add xterm+keypad+noent to serve as a common
+#        key set for other terminals; add xterm+keypad+all and
+#        xterm+keypad+novt for full-featured xterm and fix xterm-vt220
 #      (all by Jakub Horky)
 #
 ######## SHANTIH!  SHANTIH!  SHANTIH!
-- 
2.43.0


Reply via email to