Send key release event to input method. (#5281)

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
This commit is contained in:
Weng Xuetian 2022-04-05 19:30:25 -07:00 committed by GitHub
parent 8bae343f25
commit 138d96c8a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 46 additions and 41 deletions

View file

@ -339,11 +339,11 @@ SDL_Fcitx_Reset(void)
}
SDL_bool
SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode)
SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state)
{
Uint32 state = Fcitx_ModState();
Uint32 mod_state = Fcitx_ModState();
Uint32 handled = SDL_FALSE;
Uint32 is_release = SDL_FALSE;
Uint32 is_release = (state == SDL_RELEASED);
Uint32 event_time = 0;
if (!fcitx_client.ic_path) {
@ -351,7 +351,7 @@ SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode)
}
if (SDL_DBus_CallMethod(FCITX_DBUS_SERVICE, fcitx_client.ic_path, FCITX_IC_DBUS_INTERFACE, "ProcessKeyEvent",
DBUS_TYPE_UINT32, &keysym, DBUS_TYPE_UINT32, &keycode, DBUS_TYPE_UINT32, &state, DBUS_TYPE_BOOLEAN, &is_release, DBUS_TYPE_UINT32, &event_time, DBUS_TYPE_INVALID,
DBUS_TYPE_UINT32, &keysym, DBUS_TYPE_UINT32, &keycode, DBUS_TYPE_UINT32, &mod_state, DBUS_TYPE_BOOLEAN, &is_release, DBUS_TYPE_UINT32, &event_time, DBUS_TYPE_INVALID,
DBUS_TYPE_BOOLEAN, &handled, DBUS_TYPE_INVALID)) {
if (handled) {
SDL_Fcitx_UpdateTextRect(NULL);