/**
* @internal
*
+ * Get the keyboard repeat rate and delay of horizontal way
+ *
+ * @param input The input
+ * @param rate Pointer to store the repeat rate (in seconds)
+ * @param rate Pointer to store the repeat delay (in seconds)
+ *
+ * @return True if repeat is enabled
+ *
+ * @ingroup Ecore_Wl2_Input_Group
+ */
+EAPI Eina_Bool ecore_wl2_input_keyboard_horizontal_way_repeat_get(const Ecore_Wl2_Input *input, double *rate, double *delay);
+
+/**
+ * @internal
+ *
+ * Set the keyboard repeat rate and delay of horizontal way
+ * @param input The input
+ * @param rate Pointer to store the repeat rate (in seconds)
+ * @param rate Pointer to store the repeat delay (in seconds)
+ *
+ * @return True if repeat is enabled
+ *
+ * @ingroup Ecore_Wl2_Input_Group
+ */
+EAPI Eina_Bool ecore_wl2_input_keyboard_horizontal_way_repeat_set(Ecore_Wl2_Input *input, double rate, double delay);
+
+/**
+ * @internal
+ *
+ * Get the keyboard repeat rate and delay of vertical way
+ *
+ * @param input The input
+ * @param rate Pointer to store the repeat rate (in seconds)
+ * @param rate Pointer to store the repeat delay (in seconds)
+ *
+ * @return True if repeat is enabled
+ *
+ * @ingroup Ecore_Wl2_Input_Group
+ */
+EAPI Eina_Bool ecore_wl2_input_keyboard_vertical_way_repeat_get(const Ecore_Wl2_Input *input, double *rate, double *delay);
+
+/**
+ * @internal
+ *
+ * Set the keyboard repeat rate and delay of vertical way
+ * @param input The input
+ * @param rate Pointer to store the repeat rate (in seconds)
+ * @param rate Pointer to store the repeat delay (in seconds)
+ *
+ * @return True if repeat is enabled
+ *
+ * @ingroup Ecore_Wl2_Input_Group
+ */
+EAPI Eina_Bool ecore_wl2_input_keyboard_vertical_way_repeat_set(Ecore_Wl2_Input *input, double rate, double delay);
+
+/**
+ * @internal
+ *
* Set a given wl_surface to use as the pointer on a seat
*
* @param input The seat to set this surface as the pointer on
return ECORE_CALLBACK_RENEW;
}
- ecore_timer_interval_set(input->repeat.timer, input->repeat.rate);
+ if (input->repeat.key == 105 || input->repeat.key == 106 ) // Left:105 Right:106
+ ecore_timer_interval_set(input->repeat.timer, input->repeat.horizontal.rate);
+ else if (input->repeat.key == 103 || input->repeat.key == 108) { // UP:103 Down:108
+ ecore_timer_interval_set(input->repeat.timer, input->repeat.vertical.rate);
+ else
+ ecore_timer_interval_set(input->repeat.timer, input->repeat.rate);
+
input->repeat.repeating = EINA_TRUE;
}
- input->repeat.time += (int)(input->repeat.rate * 1000.0);
+ if (input->repeat.key == 105 || input->repeat.key == 106 )
+ input->repeat.time += (int)(input->repeat.horizontal.rate * 1000.0);
+ else if (input->repeat.key == 103 || input->repeat.key == 108) {
+ input->repeat.time += (int)(input->repeat.vertical.rate * 1000.0);
+ else
+ input->repeat.time += (int)(input->repeat.rate * 1000.0);
_ecore_wl2_input_key_send(input, input->repeat_win,
input->repeat.sym, input->repeat.sym_name,
if (!input->repeat.timer)
{
input->repeat.repeating = EINA_FALSE;
- input->repeat.timer = ecore_timer_add(input->repeat.delay, _keyboard_cb_repeat, input);
- input->repeat.intime = (ecore_time_get() + input->repeat.delay + 0.0166);
+ if (keycode == 105 || keycode == 106 )
+ {
+ input->repeat.timer = ecore_timer_add(input->repeat.horizontal.delay, _keyboard_cb_repeat, input);
+ input->repeat.intime = (ecore_time_get() + input->repeat.horizontal.delay + 0.0166);
+ }
+ else if (keycode == 103 || keycode == 108)
+ {
+ input->repeat.timer = ecore_timer_add(input->repeat.vertical.delay, _keyboard_cb_repeat, input);
+ input->repeat.intime = (ecore_time_get() + input->repeat.vertical.delay + 0.0166);
+ }
+ else
+ {
+ input->repeat.timer = ecore_timer_add(input->repeat.delay, _keyboard_cb_repeat, input);
+ input->repeat.intime = (ecore_time_get() + input->repeat.delay + 0.0166);
+ }
}
}
}
//TIZEN_ONLY(20200128): Tizen calculates rate differently.
//input->repeat.rate = (1.0 / rate);
//
- input->repeat.rate = (rate / 1000.0);
- input->repeat.delay = (delay / 1000.0);
+ input->repeat.rate = input->repeat.horizontal.rate = input->repeat.vertical.rate = (rate / 1000.0);
+ input->repeat.delay = input->repeat.horizontal.delay = input->repeat.vertical.delay = (delay / 1000.0);
}
ev = malloc(sizeof(Ecore_Wl2_Event_Seat_Keymap_Changed));
if (ev)
input->id = id;
input->display = display;
input->seat_version = version;
- input->repeat.rate = 0.025;
- input->repeat.delay = 0.4;
+ input->repeat.rate = input->repeat.horizontal.rate = input->repeat.vertical.rate = 0.025;
+ input->repeat.delay = input->repeat.horizontal.delay = input->repeat.vertical.delay = 0.4;
input->repeat.enabled = EINA_TRUE;
input->repeat.changed = EINA_FALSE;
EINA_SAFETY_ON_NULL_RETURN_VAL(input, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(input->display, EINA_FALSE);
EINA_SAFETY_ON_FALSE_RETURN_VAL(input->wl.keyboard, EINA_FALSE);
- input->repeat.rate = rate;
- input->repeat.delay = delay;
+ input->repeat.rate = input->repeat.horizontal.rate = input->repeat.vertical.rate = rate;
+ input->repeat.delay = input->repeat.horizontal.delay = input->repeat.vertical.delay = delay;
input->repeat.changed = EINA_TRUE;
return input->repeat.enabled;
}
return input->repeat.enabled;
}
+EAPI Eina_Bool
+ecore_wl2_input_keyboard_horizontal_way_repeat_set(Ecore_Wl2_Input *input, double rate, double delay)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(input, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(input->display, EINA_FALSE);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(input->wl.keyboard, EINA_FALSE);
+ input->repeat.horizontal.rate = rate;
+ input->repeat.horizontal.delay = delay;
+ input->repeat.changed = EINA_TRUE;
+ return input->repeat.enabled;
+}
+
+EAPI Eina_Bool
+ecore_wl2_input_keyboard_horizontal_way_repeat_get(const Ecore_Wl2_Input *input, double *rate, double *delay)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(input, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(input->display, EINA_FALSE);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(input->wl.keyboard, EINA_FALSE);
+ if (rate) *rate = input->repeat.horizontal.rate;
+ if (delay) *delay = input->repeat.horizontal.delay;
+ return input->repeat.enabled;
+}
+
+
+EAPI Eina_Bool
+ecore_wl2_input_keyboard_vertical_way_repeat_set(Ecore_Wl2_Input *input, double rate, double delay)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(input, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(input->display, EINA_FALSE);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(input->wl.keyboard, EINA_FALSE);
+ input->repeat.vertical.rate = rate;
+ input->repeat.vertical.delay = delay;
+ input->repeat.changed = EINA_TRUE;
+ return input->repeat.enabled;
+}
+
+EAPI Eina_Bool
+ecore_wl2_input_keyboard_vertical_way_repeat_get(const Ecore_Wl2_Input *input, double *rate, double *delay)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(input, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(input->display, EINA_FALSE);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(input->wl.keyboard, EINA_FALSE);
+ if (rate) *rate = input->repeat.vertical.rate;
+ if (delay) *delay = input->repeat.vertical.delay;
+ return input->repeat.enabled;
+}
+
// TIZEN_ONLY(20171207): add functions to set client's custom cursors
static void
_pointer_update_stop(Ecore_Wl2_Input *input)