summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhengxinjian <xinj.zheng@samsung.com>2023-04-10 10:40:51 +0800
committerInHong Han <inhong1.han@samsung.com>2023-04-10 16:58:42 +0900
commit33cd2e39301081e24111310bea478f189b1c5409 (patch)
tree3cdd23b9d9dbbb01d9062f20a065c01a6b79c8e9
parent71a757b72cc02d56aef42d8cf534bdf06dce238e (diff)
downloadisf-33cd2e39301081e24111310bea478f189b1c5409.tar.gz
isf-33cd2e39301081e24111310bea478f189b1c5409.tar.bz2
isf-33cd2e39301081e24111310bea478f189b1c5409.zip
Update the control logic for key repeat rate
Change-Id: I7f457692b317a75bc5da8bf83f4cc45b0139d823
-rw-r--r--ism/extras/wayland_immodule/wayland_imcontext.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/ism/extras/wayland_immodule/wayland_imcontext.c b/ism/extras/wayland_immodule/wayland_imcontext.c
index 3dff2f32..ad034b81 100644
--- a/ism/extras/wayland_immodule/wayland_imcontext.c
+++ b/ism/extras/wayland_immodule/wayland_imcontext.c
@@ -157,7 +157,7 @@ static Input_Language input_lang = INPUT_LANG_OTHER;
static void set_autocapital (Ecore_IMF_Context *ctx);
-static Eina_Bool g_key_rate_checked = EINA_FALSE, g_focused = EINA_FALSE;
+static Eina_Bool g_focused = EINA_FALSE;
static double g_original_key_rate = 0.0, g_original_key_delay = 0.0, g_desired_key_rate = 0.0;
static double g_filter_event_elapsed_time = 0.0;
static int g_last_key_event_serial = 0;
@@ -1525,21 +1525,18 @@ set_focus(Ecore_IMF_Context *ctx)
wl_text_input_activate(imcontext->text_input, seat,
ecore_wl2_window_surface_get(imcontext->window));
- if (g_key_rate_checked == EINA_FALSE && g_desired_key_rate == 0.0) {
- char *key_rate = getenv ("ISF_KEY_REPEAT_RATE");
- if (key_rate) {
- g_desired_key_rate = atof (key_rate);
- if (g_desired_key_rate > 0.0) {
- if (!ecore_wl2_input_keyboard_repeat_get (input, &g_original_key_rate, &g_original_key_delay)) {
- LOGE ("ecore_wl2_input_keyboard_repeat_get failed");
- }
- else {
- LOGD ("ecore_wl2_input_keyboard_repeat_get original rate=%f, delay=%f. Desired rate=%f",
- g_original_key_rate, g_original_key_delay, g_desired_key_rate);
- }
+ char *key_rate = getenv ("ISF_KEY_REPEAT_RATE");
+ if (key_rate) {
+ g_desired_key_rate = atof (key_rate);
+ if (g_desired_key_rate > 0.0) {
+ if (!ecore_wl2_input_keyboard_repeat_get (input, &g_original_key_rate, &g_original_key_delay)) {
+ LOGE ("ecore_wl2_input_keyboard_repeat_get failed");
+ }
+ else {
+ LOGD ("ecore_wl2_input_keyboard_repeat_get original rate=%f, delay=%f. Desired rate=%f",
+ g_original_key_rate, g_original_key_delay, g_desired_key_rate);
}
}
- g_key_rate_checked = EINA_TRUE;
}
if (g_desired_key_rate > 0.0 && g_original_key_delay > 0.0 && !g_focused) {
@@ -1587,6 +1584,7 @@ set_focus_out(Ecore_IMF_Context *ctx)
if (g_desired_key_rate > 0.0 && g_focused) {
g_focused = EINA_FALSE;
+ g_desired_key_rate = 0.0;
Ecore_Wl2_Input *input = ecore_wl2_window_keyboard_get(imcontext->window);
if (input) {