|
|
adf5181 |
From b11dfd761181ab5005fe3f5527faa4faf6b56112 Mon Sep 17 00:00:00 2001
|
|
|
adf5181 |
From: Weng Xuetian <wengxt@gmail.com>
|
|
|
adf5181 |
Date: Tue, 1 Feb 2022 14:43:26 -0800
|
|
|
adf5181 |
Subject: [PATCH 11/11] Only generate key repetition for keys that should
|
|
|
adf5181 |
repeat on wayland.
|
|
|
adf5181 |
|
|
|
adf5181 |
This fix repetition on modifier keys, e.g. Control.
|
|
|
adf5181 |
---
|
|
|
adf5181 |
src/video/wayland/SDL_waylandevents.c | 4 +++-
|
|
|
adf5181 |
src/video/wayland/SDL_waylandsym.h | 1 +
|
|
|
adf5181 |
2 files changed, 4 insertions(+), 1 deletion(-)
|
|
|
adf5181 |
|
|
|
adf5181 |
diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c
|
|
|
adf5181 |
index 85d4edfc8..55893201b 100644
|
|
|
adf5181 |
--- a/src/video/wayland/SDL_waylandevents.c
|
|
|
adf5181 |
+++ b/src/video/wayland/SDL_waylandevents.c
|
|
|
adf5181 |
@@ -987,7 +987,9 @@ keyboard_handle_key(void *data, struct wl_keyboard *keyboard,
|
|
|
adf5181 |
SDL_SendKeyboardText(text);
|
|
|
adf5181 |
}
|
|
|
adf5181 |
}
|
|
|
adf5181 |
- keyboard_repeat_set(&input->keyboard_repeat, time, scancode, has_text, text);
|
|
|
adf5181 |
+ if (input->xkb.keymap && WAYLAND_xkb_keymap_key_repeats(input->xkb.keymap, key + 8)) {
|
|
|
adf5181 |
+ keyboard_repeat_set(&input->keyboard_repeat, time, scancode, has_text, text);
|
|
|
adf5181 |
+ }
|
|
|
adf5181 |
}
|
|
|
adf5181 |
}
|
|
|
adf5181 |
|
|
|
adf5181 |
diff --git a/src/video/wayland/SDL_waylandsym.h b/src/video/wayland/SDL_waylandsym.h
|
|
|
adf5181 |
index 366ce9e94..fa29bedb1 100644
|
|
|
adf5181 |
--- a/src/video/wayland/SDL_waylandsym.h
|
|
|
adf5181 |
+++ b/src/video/wayland/SDL_waylandsym.h
|
|
|
adf5181 |
@@ -122,6 +122,7 @@ SDL_WAYLAND_SYM(int, xkb_state_key_get_syms, (struct xkb_state *, xkb_keycode_t,
|
|
|
adf5181 |
SDL_WAYLAND_SYM(int, xkb_keysym_to_utf8, (xkb_keysym_t, char *, size_t) )
|
|
|
adf5181 |
SDL_WAYLAND_SYM(struct xkb_keymap *, xkb_keymap_new_from_string, (struct xkb_context *, const char *, enum xkb_keymap_format, enum xkb_keymap_compile_flags))
|
|
|
adf5181 |
SDL_WAYLAND_SYM(struct xkb_state *, xkb_state_new, (struct xkb_keymap *) )
|
|
|
adf5181 |
+SDL_WAYLAND_SYM(int, xkb_keymap_key_repeats, (struct xkb_keymap *keymap, xkb_keycode_t key) );
|
|
|
adf5181 |
SDL_WAYLAND_SYM(void, xkb_keymap_unref, (struct xkb_keymap *) )
|
|
|
adf5181 |
SDL_WAYLAND_SYM(void, xkb_state_unref, (struct xkb_state *) )
|
|
|
adf5181 |
SDL_WAYLAND_SYM(void, xkb_context_unref, (struct xkb_context *) )
|
|
|
adf5181 |
--
|
|
|
adf5181 |
2.34.1
|
|
|
adf5181 |
|