summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/keyevents.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/keyevents.c b/src/keyevents.c
index 3c864fb..94ea920 100644
--- a/src/keyevents.c
+++ b/src/keyevents.c
@@ -379,7 +379,17 @@ void feh_event_handle_keypress(XEvent * ev)
}
kev = (XKeyEvent *) ev;
- XLookupString(&ev->xkey, (char *) kbuf, sizeof(kbuf), &keysym, NULL);
+ XrmDatabase db = XrmGetDatabase(disp);
+ XIM im = XOpenIM(disp, db, "feh", "feh");
+ XIC ic = XCreateIC(im, XNInputStyle, (XIMPreeditNone | XIMStatusNone), NULL);
+ if(ic != NULL) {
+ Status status;
+ memset(kbuf, 0, sizeof(kbuf));
+ Xutf8LookupString(ic, &ev->xkey, (char *) kbuf, sizeof(kbuf), &keysym, &status);
+ }
+ XDestroyIC(ic);
+ XCloseIM(im);
+
state = kev->state & (ControlMask | ShiftMask | Mod1Mask | Mod4Mask);
if (isascii(keysym))
@@ -452,6 +462,9 @@ void feh_event_handle_keypress(XEvent * ev)
/* append to caption */
ESTRAPPEND_CHAR(FEH_FILE(winwid->file->data)->caption, keysym);
winwidget_render_image_cached(winwid);
+ } else {
+ ESTRAPPEND(FEH_FILE(winwid->file->data)->caption, kbuf);
+ winwidget_render_image_cached(winwid);
}
break;
}