mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 19:38:14 +00:00
Revert "x11: Filter out duplicate key presses when an IME is active"
This reverts commitf4813ca2cf
. (cherry picked from commit3304d24bea
)
This commit is contained in:

committed by
Sam Lantinga

parent
ed22220bc6
commit
6feb86be71
@@ -988,11 +988,8 @@ void X11_HandleKeyEvent(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pressed) {
|
if (pressed) {
|
||||||
// Duplicate events may be sent when an IME is active; don't send multiple keydown events for the same serial.
|
X11_HandleModifierKeys(videodata, scancode, true, true);
|
||||||
if (videodata->last_key_down_serial != xevent->xkey.serial) {
|
SDL_SendKeyboardKeyIgnoreModifiers(timestamp, keyboardID, keycode, scancode, true);
|
||||||
X11_HandleModifierKeys(videodata, scancode, true, true);
|
|
||||||
SDL_SendKeyboardKeyIgnoreModifiers(timestamp, keyboardID, keycode, scancode, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Synthesize a text event if the IME didn't consume a printable character
|
// Synthesize a text event if the IME didn't consume a printable character
|
||||||
if (*text && !(SDL_GetModState() & (SDL_KMOD_CTRL | SDL_KMOD_ALT))) {
|
if (*text && !(SDL_GetModState() & (SDL_KMOD_CTRL | SDL_KMOD_ALT))) {
|
||||||
@@ -1002,7 +999,6 @@ void X11_HandleKeyEvent(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_
|
|||||||
}
|
}
|
||||||
|
|
||||||
X11_UpdateUserTime(windowdata, xevent->xkey.time);
|
X11_UpdateUserTime(windowdata, xevent->xkey.time);
|
||||||
videodata->last_key_down_serial = xevent->xkey.serial;
|
|
||||||
} else {
|
} else {
|
||||||
if (X11_KeyRepeat(display, xevent)) {
|
if (X11_KeyRepeat(display, xevent)) {
|
||||||
// We're about to get a repeated key down, ignore the key up
|
// We're about to get a repeated key down, ignore the key up
|
||||||
|
@@ -140,8 +140,6 @@ struct SDL_VideoData
|
|||||||
int xinput_master_pointer_device;
|
int xinput_master_pointer_device;
|
||||||
bool xinput_hierarchy_changed;
|
bool xinput_hierarchy_changed;
|
||||||
|
|
||||||
unsigned long last_key_down_serial;
|
|
||||||
|
|
||||||
int xrandr_event_base;
|
int xrandr_event_base;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user