From: Yuuki Harano Date: Mon, 21 Sep 2020 15:14:34 +0000 (+0900) Subject: Exclude Xlib's modifier keys X-Git-Tag: emacs-29.0.90~3776 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7c8da336138eb799bcba8583cb18fc8b3cfe7347;p=emacs.git Exclude Xlib's modifier keys * src/pgtkterm.c (IsModifierKey): New macro. (key_press_event): Exclude Xlib's modifier keys. --- diff --git a/src/pgtkterm.c b/src/pgtkterm.c index d62e2a3b16d..224c01551b7 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -5464,6 +5464,12 @@ pgtk_emacs_to_gtk_modifiers (struct pgtk_display_info *dpyinfo, int state) #define IsMiscFunctionKey(keysym) (0xff60 <= (keysym) && (keysym) < 0xff6c) #define IsKeypadKey(keysym) (0xff80 <= (keysym) && (keysym) < 0xffbe) #define IsFunctionKey(keysym) (0xffbe <= (keysym) && (keysym) < 0xffe1) +#define IsModifierKey(keysym) \ + ((((keysym) >= GDK_KEY_Shift_L) && ((keysym) <= GDK_KEY_Hyper_R)) \ + || (((keysym) >= GDK_KEY_ISO_Lock) && ((keysym) <= GDK_KEY_ISO_Level5_Lock)) \ + || ((keysym) == GDK_KEY_Mode_switch) \ + || ((keysym) == GDK_KEY_Num_Lock)) + void pgtk_enqueue_string (struct frame *f, gchar * str) @@ -5680,6 +5686,10 @@ key_press_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data) || (orig_keysym & (1 << 28)) || (keysym != GDK_KEY_VoidSymbol && nbytes == 0)) && !(event->key.is_modifier + /* Gtk's modifier keys are different from Xlib's ones. + * I need to exclude them. + */ + || IsModifierKey (orig_keysym) /* The symbols from GDK_KEY_ISO_Lock to GDK_KEY_ISO_Last_Group_Lock don't have real modifiers but