Skip to content

Commit 3304d24

Browse files
Kontrabantslouken
authored andcommitted
Revert "x11: Filter out duplicate key presses when an IME is active"
This reverts commit f4813ca.
1 parent cd95152 commit 3304d24

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/video/x11/SDL_x11events.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -988,11 +988,8 @@ void X11_HandleKeyEvent(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_
988988
}
989989

990990
if (pressed) {
991-
// Duplicate events may be sent when an IME is active; don't send multiple keydown events for the same serial.
992-
if (videodata->last_key_down_serial != xevent->xkey.serial) {
993-
X11_HandleModifierKeys(videodata, scancode, true, true);
994-
SDL_SendKeyboardKeyIgnoreModifiers(timestamp, keyboardID, keycode, scancode, true);
995-
}
991+
X11_HandleModifierKeys(videodata, scancode, true, true);
992+
SDL_SendKeyboardKeyIgnoreModifiers(timestamp, keyboardID, keycode, scancode, true);
996993

997994
// Synthesize a text event if the IME didn't consume a printable character
998995
if (*text && !(SDL_GetModState() & (SDL_KMOD_CTRL | SDL_KMOD_ALT))) {
@@ -1002,7 +999,6 @@ void X11_HandleKeyEvent(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_
1002999
}
10031000

10041001
X11_UpdateUserTime(windowdata, xevent->xkey.time);
1005-
videodata->last_key_down_serial = xevent->xkey.serial;
10061002
} else {
10071003
if (X11_KeyRepeat(display, xevent)) {
10081004
// We're about to get a repeated key down, ignore the key up

src/video/x11/SDL_x11video.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ struct SDL_VideoData
140140
int xinput_master_pointer_device;
141141
bool xinput_hierarchy_changed;
142142

143-
unsigned long last_key_down_serial;
144-
145143
int xrandr_event_base;
146144
struct
147145
{

0 commit comments

Comments
 (0)