Skip to content

Commit

Permalink
fcitx: Use XLookupString instead of XLookupKeysym to fix modifier keys
Browse files Browse the repository at this point in the history
See: #142
  • Loading branch information
JGRennison committed May 5, 2020
1 parent b11852a commit 197a4f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/video/sdl2_v.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <SDL_syswm.h>
#include <X11/Xlib.h>
#include <X11/keysym.h>
#include <X11/Xutil.h>
#include <unistd.h>
#endif

Expand Down Expand Up @@ -254,7 +255,9 @@ static void FcitxSYSWMEVENT(const SDL_SysWMEvent &event)
if (event.msg->subsystem != SDL_SYSWM_X11) return;
XEvent &xevent = event.msg->msg.x11.event;
if (xevent.type == KeyPress) {
KeySym keysym = XLookupKeysym(&xevent.xkey, 0);
char text[8];
KeySym keysym = 0;
XLookupString(&xevent.xkey, text, lengthof(text), &keysym, nullptr);
_fcitx_last_keycode = xevent.xkey.keycode;
_fcitx_last_keysym = keysym;
}
Expand Down

0 comments on commit 197a4f2

Please sign in to comment.