Skip to content

Commit 9a32dab

Browse files
author
Yuuki Harano
committed
filter keypress はしておくことにした。
意味あるのかどうかわからないが...
1 parent 921e167 commit 9a32dab

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

src/pgtkim.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,16 @@ void pgtk_im_focus_out(struct frame *f)
174174
}
175175
}
176176

177+
bool pgtk_im_filter_keypress(struct frame *f, GdkEventKey *ev)
178+
{
179+
struct pgtk_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
180+
if (dpyinfo->im.context != NULL) {
181+
if (gtk_im_context_filter_keypress (dpyinfo->im.context, ev))
182+
return true;
183+
}
184+
return false;
185+
}
186+
177187
void pgtk_im_init(struct pgtk_display_info *dpyinfo)
178188
{
179189
dpyinfo->im.context = NULL;

src/pgtkterm.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5033,6 +5033,11 @@ static gboolean key_press_event(GtkWidget *widget, GdkEvent *event, gpointer *us
50335033
hlinfo->mouse_face_hidden = true;
50345034
}
50355035

5036+
if (f != 0) {
5037+
if (pgtk_im_filter_keypress (f, &event->key))
5038+
return TRUE;
5039+
}
5040+
50365041
if (f != 0)
50375042
{
50385043
guint keysym, orig_keysym;

src/pgtkterm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,7 @@ extern void pgtk_enqueue_string(struct frame *f, gchar *str);
620620
extern void pgtk_enqueue_preedit(struct frame *f, Lisp_Object image_data);
621621
extern void pgtk_im_focus_in(struct frame *f);
622622
extern void pgtk_im_focus_out(struct frame *f);
623+
extern bool pgtk_im_filter_keypress(struct frame *f, GdkEventKey *ev);
623624
extern void pgtk_im_init(struct pgtk_display_info *dpyinfo);
624625
extern void pgtk_im_finish(struct pgtk_display_info *dpyinfo);
625626

0 commit comments

Comments
 (0)