To: vim-dev@vim.org Subject: Patch 6.1.330 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.330 Problem: GTK, Motif and Athena: Keypad keys produce the same code as non-keypad keys, making it impossible to map them separately. Solution: Use different termcap codes for the keypad keys. (Neil Bird) Files: src/gui_gtk_x11.c, src/gui_x11.c *** ../vim61.329/src/gui_gtk_x11.c Sat Aug 3 14:16:11 2002 --- src/gui_gtk_x11.c Thu Feb 13 17:20:40 2003 *************** *** 136,141 **** --- 136,143 ---- /* * Keycodes recognized by vim. + * NOTE: when changing this, the table in gui_x11.c probably needs the same + * change! */ static struct special_key { *************** *** 202,213 **** {GDK_KP_Right, 'k', 'r'}, {GDK_KP_Up, 'k', 'u'}, {GDK_KP_Down, 'k', 'd'}, ! {GDK_KP_Insert, 'k', 'I'}, ! {GDK_KP_Delete, 'k', 'D'}, ! {GDK_KP_Home, 'k', 'h'}, ! {GDK_KP_End, '@', '7'}, ! {GDK_KP_Prior, 'k', 'P'}, ! {GDK_KP_Next, 'k', 'N'}, {GDK_KP_Add, 'K', '6'}, {GDK_KP_Subtract, 'K', '7'}, --- 204,215 ---- {GDK_KP_Right, 'k', 'r'}, {GDK_KP_Up, 'k', 'u'}, {GDK_KP_Down, 'k', 'd'}, ! {GDK_KP_Insert, KS_EXTRA, KE_KINS}, ! {GDK_KP_Delete, KS_EXTRA, KE_KDEL}, ! {GDK_KP_Home, 'K', '1'}, ! {GDK_KP_End, 'K', '4'}, ! {GDK_KP_Prior, 'K', '3'}, /* page up */ ! {GDK_KP_Next, 'K', '5'}, /* page down */ {GDK_KP_Add, 'K', '6'}, {GDK_KP_Subtract, 'K', '7'}, *************** *** 785,792 **** #endif } ! /* Check for special keys, making sure BS and DEL are recognized. */ ! if (len == 0 || key_sym == GDK_BackSpace || key_sym == GDK_Delete) { for (i = 0; special_keys[i].key_sym != 0; i++) { --- 816,824 ---- #endif } ! /* Check for special keys. Also do this when len == 1 (key has an ASCII ! * value) to detect backspace, delete and keypad keys. */ ! if (len == 0 || len == 1) { for (i = 0; special_keys[i].key_sym != 0; i++) { *** ../vim61.329/src/gui_x11.c Sun Oct 27 20:38:46 2002 --- src/gui_x11.c Thu Feb 13 17:26:16 2003 *************** *** 143,148 **** --- 143,153 ---- static Cursor gui_x11_create_blank_mouse __ARGS((void)); + /* + * Keycodes recognized by vim. + * NOTE: when changing this, the table in gui_gtk_x11.c probably needs the + * same change! + */ static struct specialkey { KeySym key_sym; *************** *** 215,226 **** {XK_KP_Right, 'k', 'r'}, {XK_KP_Up, 'k', 'u'}, {XK_KP_Down, 'k', 'd'}, ! {XK_KP_Insert, 'k', 'I'}, ! {XK_KP_Delete, 'k', 'D'}, ! {XK_KP_Home, 'k', 'h'}, ! {XK_KP_End, '@', '7'}, ! {XK_KP_Prior, 'k', 'P'}, ! {XK_KP_Next, 'k', 'N'}, {XK_KP_Add, 'K', '6'}, {XK_KP_Subtract, 'K', '7'}, --- 220,231 ---- {XK_KP_Right, 'k', 'r'}, {XK_KP_Up, 'k', 'u'}, {XK_KP_Down, 'k', 'd'}, ! {XK_KP_Insert, KS_EXTRA, KE_KINS}, ! {XK_KP_Delete, KS_EXTRA, KE_KDEL}, ! {XK_KP_Home, 'K', '1'}, ! {XK_KP_End, 'K', '4'}, ! {XK_KP_Prior, 'K', '3'}, ! {XK_KP_Next, 'K', '5'}, {XK_KP_Add, 'K', '6'}, {XK_KP_Subtract, 'K', '7'}, *** ../vim61.329/src/version.c Sun Feb 16 22:08:10 2003 --- src/version.c Sun Feb 16 22:10:24 2003 *************** *** 608,609 **** --- 612,615 ---- { /* Add new patch number below this line */ + /**/ + 330, /**/ -- hundred-and-one symptoms of being an internet addict: 269. You wonder how you can make your dustbin produce Sesame Street's Oscar's the Garbage Monster song when you empty it. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///