Hello,

This is a patch for rxvt-CVS that makes XK_KP_Insert and XK_KP_Delete
work like the rest of XK_KP_xxx family (according to application keypad
mode and shift state).  This is consistent with XFree86 xterm and IMHO
generally the Right Thing (TM).

BTW are there any patch submission guidelines?  I just did a cvs diff -u
in .../rxvt/

Index: src/command.c
===================================================================
RCS file: /cvsroot/rxvt/rxvt/src/command.c,v
retrieving revision 1.197
diff -u -r1.197 command.c
--- src/command.c       2001/01/30 19:57:51     1.197
+++ src/command.c       2001/02/05 15:40:06
@@ -25,6 +25,8 @@
  * Copyright (C) 1998,1999,2000        Geoff Wing <[EMAIL PROTECTED]>
  *                             - extensive modifications
  * Copyright (C) 1998      Alfredo K. Kojima <[EMAIL PROTECTED]>
+ * Copyright (C) 2001      Marius Gedminas <[EMAIL PROTECTED]>
+ *                             - KP_Insert/KP_Delete fixes
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -238,6 +240,15 @@
                    break;
 #endif
 #ifndef NO_DELETE_KEY
+# ifdef XK_KP_Delete
+               case XK_KP_Delete:
+               /* allow shift to override */
+                   if ((r->h->PrivateModes & PrivMode_aplKP) ? !shft : shft) {
+                       STRCPY(kbuf, "\033On");
+                       break;
+                   }
+               /* FALLTHROUGH */
+# endif
                case XK_Delete:
                    STRCPY(kbuf, r->h->key_delete);
                    break;
@@ -320,15 +331,8 @@
                case XK_KP_Begin:
                    STRCPY(kbuf, "\033Ou");
                    break;
-
-               case XK_KP_Insert:
-                   STRCPY(kbuf, "\033Op");
-                   break;
-
-               case XK_KP_Delete:
-                   STRCPY(kbuf, "\033On");
-                   break;
 #endif
+
                case XK_KP_F1:  /* "\033OP" */
                case XK_KP_F2:  /* "\033OQ" */
                case XK_KP_F3:  /* "\033OR" */
@@ -366,9 +370,20 @@
                case XK_Find:
                    STRCPY(kbuf, "\033[1~");
                    break;
+
+#ifdef XK_KP_Insert
+               case XK_KP_Insert:
+               /* allow shift to override */
+                   if ((r->h->PrivateModes & PrivMode_aplKP) ? !shft : shft) {
+                       STRCPY(kbuf, "\033Op");
+                       break;
+                   }
+               /* FALLTHROUGH */
+#endif
                case XK_Insert:
                    STRCPY(kbuf, "\033[2~");
                    break;
+
 #ifdef DXK_Remove              /* support for DEC remove like key */
                case DXK_Remove:
                /* FALLTHROUGH */


Marius Gedminas
-- 
This sentence does in fact not have the property it claims not to have.

Reply via email to