[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/pgtk 7c8da33 084/100: Exclude Xlib's modifier keys
From: |
Yuuki Harano |
Subject: |
feature/pgtk 7c8da33 084/100: Exclude Xlib's modifier keys |
Date: |
Tue, 24 Nov 2020 08:02:43 -0500 (EST) |
branch: feature/pgtk
commit 7c8da336138eb799bcba8583cb18fc8b3cfe7347
Author: Yuuki Harano <masm+github@masm11.me>
Commit: Jeff Walsh <jeff.walsh@drtusers-MacBook-Pro.local>
Exclude Xlib's modifier keys
* src/pgtkterm.c (IsModifierKey): New macro.
(key_press_event): Exclude Xlib's modifier keys.
---
src/pgtkterm.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index d62e2a3..224c015 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
- feature/pgtk e7190d8 075/100: Fix non-English layout does not work, (continued)
- feature/pgtk e7190d8 075/100: Fix non-English layout does not work, Yuuki Harano, 2020/11/24
- feature/pgtk 28073ba 083/100: Re-implement childframe with emacsgtkfixed, Yuuki Harano, 2020/11/24
- feature/pgtk 6c43496 074/100: Fix font lock is not applied on continued lines, Yuuki Harano, 2020/11/24
- feature/pgtk 9704e23 081/100: Enable GtkIMContext by default, Yuuki Harano, 2020/11/24
- feature/pgtk b60d4c9 086/100: Fix crash on creating child frames., Yuuki Harano, 2020/11/24
- feature/pgtk b1b7440 098/100: Work around gtk_im_context_filter_keypress() issue with super key, Yuuki Harano, 2020/11/24
- feature/pgtk 992ef48 041/100: update redisplay_interface., Yuuki Harano, 2020/11/24
- feature/pgtk 232c129 035/100: implement pre-edit input method, Yuuki Harano, 2020/11/24
- feature/pgtk 984f9cc 050/100: restore frame_rehighlight_hook., Yuuki Harano, 2020/11/24
- feature/pgtk 51462ce 078/100: Add PGTK to system-configuration-features, Yuuki Harano, 2020/11/24
- feature/pgtk 7c8da33 084/100: Exclude Xlib's modifier keys,
Yuuki Harano <=
- feature/pgtk 2d5ffa5 076/100: Make pointer visible when motion notify event, Yuuki Harano, 2020/11/24
- feature/pgtk 2dd20b2 079/100: Self-implement tooltip, Yuuki Harano, 2020/11/24
- feature/pgtk e75ce03 082/100: Add support for x-support-frames, Yuuki Harano, 2020/11/24
- feature/pgtk 6df8556 080/100: Remove duplicated syms_of_xwidget call, Yuuki Harano, 2020/11/24
- feature/pgtk 948e2fa 094/100: Avoid weird behavior when resizing with top-left corner, Yuuki Harano, 2020/11/24
- feature/pgtk 4dbea5b 090/100: Fix Gtk warnings, Yuuki Harano, 2020/11/24
- feature/pgtk c1fbfb3 093/100: Don't use gtk_window_resize to resize offscreen window, Yuuki Harano, 2020/11/24
- feature/pgtk 7b6fea8 091/100: Avoid mutating invocation-name (tiny change), Yuuki Harano, 2020/11/24
- feature/pgtk 8fa5427 097/100: lisp/term/pgtk-win.el: Add copyright file header, Yuuki Harano, 2020/11/24
- feature/pgtk 731b5e8 099/100: Add copyright line, Yuuki Harano, 2020/11/24