diff --git a/src/pgtkim.c b/src/pgtkim.c
index c0104ebc0a..6e4c763b08 100644
--- a/src/pgtkim.c
+++ b/src/pgtkim.c
@@ -18,6 +18,8 @@ Copyright (C) 1989, 1993-1994, 2005-2006, 2008-2020 Free Software
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see . */
+#include
+
/* This should be the first include, as it may set up #defines affecting
interpretation of even the system includes. */
#include
@@ -201,6 +203,12 @@ pgtk_im_focus_out (struct frame *f)
bool
pgtk_im_filter_keypress (struct frame *f, GdkEventKey * ev)
{
+ if (ev->state & GDK_SHIFT_MASK)
+ fprintf(stderr, "S-");
+ if (ev->state & GDK_CONTROL_MASK)
+ fprintf(stderr, "C-");
+ fprintf(stderr, "%s\n", gdk_keyval_name(ev->keyval));
+
struct pgtk_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
if (dpyinfo->im.context != NULL)
{