To: vim-dev@vim.org Subject: Patch 5.6.076 Fcc: outbox From: Bram Moolenaar ------------ Patch 5.6.076 Problem: GTK GUI: Mapping doesn't work. Solution: Don't use the "Alt" modifier twice in key_press_event(). Files: src/gui_gtk_x11.c *** ../vim-5.6.75/src/gui_gtk_x11.c Thu Jun 1 19:54:27 2000 --- src/gui_gtk_x11.c Fri Jun 2 14:29:18 2000 *************** *** 511,523 **** int i; int modifiers; int key; key_sym = event->keyval; len = event->length; g_assert(len <= sizeof(string)); #ifdef HANGUL_INPUT ! if (event->keyval == GDK_space && (event->state & GDK_SHIFT_MASK)) { hangul_input_state_toggle(); return TRUE; --- 511,525 ---- int i; int modifiers; int key; + guint state; key_sym = event->keyval; len = event->length; + state = event->state; g_assert(len <= sizeof(string)); #ifdef HANGUL_INPUT ! if (event->keyval == GDK_space && (state & GDK_SHIFT_MASK)) { hangul_input_state_toggle(); return TRUE; *************** *** 531,538 **** if (key_sym == GDK_ISO_Left_Tab) key_sym = GDK_Tab; ! if ((key_sym == GDK_2 || key_sym == GDK_at) ! && (event->state & GDK_CONTROL_MASK)) { string[0] = NUL; /* CTRL-2 and CTRL-@ is NUL */ len = 1; --- 533,539 ---- if (key_sym == GDK_ISO_Left_Tab) key_sym = GDK_Tab; ! if ((key_sym == GDK_2 || key_sym == GDK_at) && (state & GDK_CONTROL_MASK)) { string[0] = NUL; /* CTRL-2 and CTRL-@ is NUL */ len = 1; *************** *** 548,554 **** #ifdef WANT_MENU /* If there is a menu and 'wak' is "yes", or 'wak' is "menu" and the key * is a menu shortcut, we ignore everything with the ALT modifier. */ ! if ((event->state & GDK_MOD1_MASK) && gui.menu_is_active && (*p_wak == 'y' || (*p_wak == 'm' --- 549,555 ---- #ifdef WANT_MENU /* If there is a menu and 'wak' is "yes", or 'wak' is "menu" and the key * is a menu shortcut, we ignore everything with the ALT modifier. */ ! if ((state & GDK_MOD1_MASK) && gui.menu_is_active && (*p_wak == 'y' || (*p_wak == 'm' *************** *** 558,568 **** #endif /* Check for Alt/Meta key (Mod1Mask) */ ! if (len == 1 && (event->state & GDK_MOD1_MASK) && !(key_sym == GDK_BackSpace || key_sym == GDK_Delete)) { /* Don't do this for , that should become K_S_TAB with ALT. */ ! if (!(key_sym == GDK_Tab && (event->state & GDK_SHIFT_MASK))) string[0] |= 0x80; } /* Check for special keys, making sure BS and DEL are recognised. */ --- 559,572 ---- #endif /* Check for Alt/Meta key (Mod1Mask) */ ! if (len == 1 && (state & GDK_MOD1_MASK) && !(key_sym == GDK_BackSpace || key_sym == GDK_Delete)) { /* Don't do this for , that should become K_S_TAB with ALT. */ ! if (!(key_sym == GDK_Tab && (state & GDK_SHIFT_MASK))) ! { string[0] |= 0x80; + state &= ~GDK_MOD1_MASK; /* don't use it again */ + } } /* Check for special keys, making sure BS and DEL are recognised. */ *************** *** 586,596 **** key_sym == GDK_Return || key_sym == GDK_Linefeed || key_sym == GDK_Escape) { modifiers = 0; ! if (event->state & GDK_SHIFT_MASK) modifiers |= MOD_MASK_SHIFT; ! if (event->state & GDK_CONTROL_MASK) modifiers |= MOD_MASK_CTRL; ! if (event->state & GDK_MOD1_MASK) modifiers |= MOD_MASK_ALT; #if defined(USE_XIM) && defined(MULTI_BYTE) /* It seems GDK returns GDK_VoidSymbol if the len is 3 and it --- 590,600 ---- key_sym == GDK_Return || key_sym == GDK_Linefeed || key_sym == GDK_Escape) { modifiers = 0; ! if (state & GDK_SHIFT_MASK) modifiers |= MOD_MASK_SHIFT; ! if (state & GDK_CONTROL_MASK) modifiers |= MOD_MASK_CTRL; ! if (state & GDK_MOD1_MASK) modifiers |= MOD_MASK_ALT; #if defined(USE_XIM) && defined(MULTI_BYTE) /* It seems GDK returns GDK_VoidSymbol if the len is 3 and it *** ../vim-5.6.75/src/version.c Fri Jun 2 14:37:04 2000 --- src/version.c Fri Jun 2 14:30:07 2000 *************** *** 420,421 **** --- 420,423 ---- { /* Add new patch number below this line */ + /**/ + 76, /**/ -- Another bucket of what can only be described as human ordure hits ARTHUR. ARTHUR: ... Right! (to the KNIGHTS) That settles it! "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /-/-- Bram Moolenaar --- Bram@moolenaar.net --- http://www.moolenaar.net --\-\ \-\-- Vim: http://www.vim.org ---- ICCF Holland: http://www.vim.org/iccf --/-/