aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_input_evas
diff options
context:
space:
mode:
authorGuilherme Iscaro <iscaro@profusion.mobi>2016-11-09 11:44:18 -0200
committerBruno Dilly <bdilly@profusion.mobi>2016-12-02 09:57:50 -0200
commitad1d160bb62f568940ab6702a559e5b108b0cac0 (patch)
treea4f7c69bc5ae42787f10774088d459339750fd23 /src/lib/ecore_input_evas
parentEvas: Add support for per seat modifiers and locks. (diff)
downloadefl-ad1d160bb62f568940ab6702a559e5b108b0cac0.tar.gz
Ecore Input Evas: Add ecore_event_evas_seat_modifier_lock_update().
This function will set the modifiers/lock per seat in Evas. Some places will still use ecore_event_evas_modifier_lock_update(), since multi-seat is not supported.
Diffstat (limited to 'src/lib/ecore_input_evas')
-rw-r--r--src/lib/ecore_input_evas/Ecore_Input_Evas.h3
-rw-r--r--src/lib/ecore_input_evas/ecore_input_evas.c68
2 files changed, 45 insertions, 26 deletions
diff --git a/src/lib/ecore_input_evas/Ecore_Input_Evas.h b/src/lib/ecore_input_evas/Ecore_Input_Evas.h
index c9b0c053fd..e126e45805 100644
--- a/src/lib/ecore_input_evas/Ecore_Input_Evas.h
+++ b/src/lib/ecore_input_evas/Ecore_Input_Evas.h
@@ -59,6 +59,9 @@ EAPI void ecore_event_window_ignore_events(Ecore_Window id, int ignore_even
EAPI void ecore_event_evas_modifier_lock_update(Evas *e, unsigned int modifiers);
+EAPI void ecore_event_evas_seat_modifier_lock_update(Evas *e, unsigned int modifiers,
+ Evas_Device *seat); /**< @since 1.19 */
+
#ifdef ECORE_EVAS_INTERNAL
typedef Eina_Bool (*Ecore_Event_Direct_Input_Cb)(void *window, int type, const void *info);
EAPI void _ecore_event_window_direct_cb_set(Ecore_Window id, Ecore_Event_Direct_Input_Cb fptr);
diff --git a/src/lib/ecore_input_evas/ecore_input_evas.c b/src/lib/ecore_input_evas/ecore_input_evas.c
index 6e37cc6d12..735ad27b0f 100644
--- a/src/lib/ecore_input_evas/ecore_input_evas.c
+++ b/src/lib/ecore_input_evas/ecore_input_evas.c
@@ -278,50 +278,57 @@ _ecore_event_evas_push_mouse_move(Ecore_Event_Mouse_Move *e)
}
EAPI void
-ecore_event_evas_modifier_lock_update(Evas *e, unsigned int modifiers)
+ecore_event_evas_seat_modifier_lock_update(Evas *e, unsigned int modifiers,
+ Evas_Device *seat)
{
if (modifiers & ECORE_EVENT_MODIFIER_SHIFT)
- evas_key_modifier_on(e, "Shift");
- else evas_key_modifier_off(e, "Shift");
+ evas_seat_key_modifier_on(e, "Shift", seat);
+ else evas_seat_key_modifier_off(e, "Shift", seat);
if (modifiers & ECORE_EVENT_MODIFIER_CTRL)
- evas_key_modifier_on(e, "Control");
- else evas_key_modifier_off(e, "Control");
+ evas_seat_key_modifier_on(e, "Control", seat);
+ else evas_seat_key_modifier_off(e, "Control", seat);
if (modifiers & ECORE_EVENT_MODIFIER_ALT)
- evas_key_modifier_on(e, "Alt");
- else evas_key_modifier_off(e, "Alt");
+ evas_seat_key_modifier_on(e, "Alt", seat);
+ else evas_seat_key_modifier_off(e, "Alt", seat);
if (modifiers & ECORE_EVENT_MODIFIER_WIN)
{
- evas_key_modifier_on(e, "Super");
- evas_key_modifier_on(e, "Hyper");
+ evas_seat_key_modifier_on(e, "Super", seat);
+ evas_seat_key_modifier_on(e, "Hyper", seat);
}
else
{
- evas_key_modifier_off(e, "Super");
- evas_key_modifier_off(e, "Hyper");
+ evas_seat_key_modifier_off(e, "Super", seat);
+ evas_seat_key_modifier_off(e, "Hyper", seat);
}
if (modifiers & ECORE_EVENT_MODIFIER_ALTGR)
- evas_key_modifier_on(e, "AltGr");
- else evas_key_modifier_off(e, "AltGr");
+ evas_seat_key_modifier_on(e, "AltGr", seat);
+ else evas_seat_key_modifier_off(e, "AltGr", seat);
if (modifiers & ECORE_EVENT_LOCK_SCROLL)
- evas_key_lock_on(e, "Scroll_Lock");
- else evas_key_lock_off(e, "Scroll_Lock");
+ evas_seat_key_lock_on(e, "Scroll_Lock", seat);
+ else evas_seat_key_lock_off(e, "Scroll_Lock", seat);
if (modifiers & ECORE_EVENT_LOCK_NUM)
- evas_key_lock_on(e, "Num_Lock");
- else evas_key_lock_off(e, "Num_Lock");
+ evas_seat_key_lock_on(e, "Num_Lock", seat);
+ else evas_seat_key_lock_off(e, "Num_Lock", seat);
if (modifiers & ECORE_EVENT_LOCK_CAPS)
- evas_key_lock_on(e, "Caps_Lock");
- else evas_key_lock_off(e, "Caps_Lock");
+ evas_seat_key_lock_on(e, "Caps_Lock", seat);
+ else evas_seat_key_lock_off(e, "Caps_Lock", seat);
if (modifiers & ECORE_EVENT_LOCK_SHIFT)
- evas_key_lock_on(e, "Shift_Lock");
- else evas_key_lock_off(e, "Shift_Lock");
+ evas_seat_key_lock_on(e, "Shift_Lock", seat);
+ else evas_seat_key_lock_off(e, "Shift_Lock", seat);
+}
+
+EAPI void
+ecore_event_evas_modifier_lock_update(Evas *e, unsigned int modifiers)
+{
+ ecore_event_evas_seat_modifier_lock_update(e, modifiers, NULL);
}
EAPI void
@@ -412,7 +419,9 @@ _ecore_event_evas_key(Ecore_Event_Key *e, Ecore_Event_Press press)
lookup = _ecore_event_window_match(e->event_window);
if (!lookup) return ECORE_CALLBACK_PASS_ON;
- ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers);
+ ecore_event_evas_seat_modifier_lock_update(lookup->evas,
+ e->modifiers,
+ efl_input_device_seat_get(e->dev));
if (press == ECORE_DOWN)
{
if (!lookup->direct ||
@@ -521,7 +530,9 @@ _ecore_event_evas_mouse_button(Ecore_Event_Mouse_Button *e, Ecore_Event_Press pr
if (e->multi.device == 0)
{
- ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers);
+ ecore_event_evas_seat_modifier_lock_update(lookup->evas,
+ e->modifiers,
+ efl_input_device_seat_get(e->dev));
if (press == ECORE_DOWN)
{
if (!lookup->direct ||
@@ -601,7 +612,9 @@ ecore_event_evas_mouse_move(void *data EINA_UNUSED, int type EINA_UNUSED, void *
if (e->multi.device == 0)
{
_ecore_event_evas_push_mouse_move(e);
- ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers);
+ ecore_event_evas_seat_modifier_lock_update(lookup->evas,
+ e->modifiers,
+ efl_input_device_seat_get(e->dev));
if (!lookup->direct ||
!lookup->direct(lookup->window, ECORE_EVENT_MOUSE_MOVE, e))
{
@@ -660,7 +673,9 @@ _ecore_event_evas_mouse_io(Ecore_Event_Mouse_IO *e, Ecore_Event_IO io)
lookup = _ecore_event_window_match(e->event_window);
if (!lookup) return ECORE_CALLBACK_PASS_ON;
- ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers);
+ ecore_event_evas_seat_modifier_lock_update(lookup->evas,
+ e->modifiers,
+ efl_input_device_seat_get(e->dev));
switch (io)
{
case ECORE_IN:
@@ -706,7 +721,8 @@ ecore_event_evas_mouse_wheel(void *data EINA_UNUSED, int type EINA_UNUSED, void
e = event;
lookup = _ecore_event_window_match(e->event_window);
if (!lookup) return ECORE_CALLBACK_PASS_ON;
- ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers);
+ ecore_event_evas_seat_modifier_lock_update(lookup->evas, e->modifiers,
+ efl_input_device_seat_get(e->dev));
if (!lookup->direct ||
!lookup->direct(lookup->window, ECORE_EVENT_MOUSE_WHEEL, e))
{