summaryrefslogtreecommitdiff
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
parentc3ed1d3154a0a3fda0dfb05b428f686422e779a6 (diff)
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
59 59
60EAPI void ecore_event_evas_modifier_lock_update(Evas *e, unsigned int modifiers); 60EAPI void ecore_event_evas_modifier_lock_update(Evas *e, unsigned int modifiers);
61 61
62EAPI void ecore_event_evas_seat_modifier_lock_update(Evas *e, unsigned int modifiers,
63 Evas_Device *seat); /**< @since 1.19 */
64
62#ifdef ECORE_EVAS_INTERNAL 65#ifdef ECORE_EVAS_INTERNAL
63typedef Eina_Bool (*Ecore_Event_Direct_Input_Cb)(void *window, int type, const void *info); 66typedef Eina_Bool (*Ecore_Event_Direct_Input_Cb)(void *window, int type, const void *info);
64EAPI void _ecore_event_window_direct_cb_set(Ecore_Window id, Ecore_Event_Direct_Input_Cb fptr); 67EAPI 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)
278} 278}
279 279
280EAPI void 280EAPI void
281ecore_event_evas_modifier_lock_update(Evas *e, unsigned int modifiers) 281ecore_event_evas_seat_modifier_lock_update(Evas *e, unsigned int modifiers,
282 Evas_Device *seat)
282{ 283{
283 if (modifiers & ECORE_EVENT_MODIFIER_SHIFT) 284 if (modifiers & ECORE_EVENT_MODIFIER_SHIFT)
284 evas_key_modifier_on(e, "Shift"); 285 evas_seat_key_modifier_on(e, "Shift", seat);
285 else evas_key_modifier_off(e, "Shift"); 286 else evas_seat_key_modifier_off(e, "Shift", seat);
286 287
287 if (modifiers & ECORE_EVENT_MODIFIER_CTRL) 288 if (modifiers & ECORE_EVENT_MODIFIER_CTRL)
288 evas_key_modifier_on(e, "Control"); 289 evas_seat_key_modifier_on(e, "Control", seat);
289 else evas_key_modifier_off(e, "Control"); 290 else evas_seat_key_modifier_off(e, "Control", seat);
290 291
291 if (modifiers & ECORE_EVENT_MODIFIER_ALT) 292 if (modifiers & ECORE_EVENT_MODIFIER_ALT)
292 evas_key_modifier_on(e, "Alt"); 293 evas_seat_key_modifier_on(e, "Alt", seat);
293 else evas_key_modifier_off(e, "Alt"); 294 else evas_seat_key_modifier_off(e, "Alt", seat);
294 295
295 if (modifiers & ECORE_EVENT_MODIFIER_WIN) 296 if (modifiers & ECORE_EVENT_MODIFIER_WIN)
296 { 297 {
297 evas_key_modifier_on(e, "Super"); 298 evas_seat_key_modifier_on(e, "Super", seat);
298 evas_key_modifier_on(e, "Hyper"); 299 evas_seat_key_modifier_on(e, "Hyper", seat);
299 } 300 }
300 else 301 else
301 { 302 {
302 evas_key_modifier_off(e, "Super"); 303 evas_seat_key_modifier_off(e, "Super", seat);
303 evas_key_modifier_off(e, "Hyper"); 304 evas_seat_key_modifier_off(e, "Hyper", seat);
304 } 305 }
305 306
306 if (modifiers & ECORE_EVENT_MODIFIER_ALTGR) 307 if (modifiers & ECORE_EVENT_MODIFIER_ALTGR)
307 evas_key_modifier_on(e, "AltGr"); 308 evas_seat_key_modifier_on(e, "AltGr", seat);
308 else evas_key_modifier_off(e, "AltGr"); 309 else evas_seat_key_modifier_off(e, "AltGr", seat);
309 310
310 if (modifiers & ECORE_EVENT_LOCK_SCROLL) 311 if (modifiers & ECORE_EVENT_LOCK_SCROLL)
311 evas_key_lock_on(e, "Scroll_Lock"); 312 evas_seat_key_lock_on(e, "Scroll_Lock", seat);
312 else evas_key_lock_off(e, "Scroll_Lock"); 313 else evas_seat_key_lock_off(e, "Scroll_Lock", seat);
313 314
314 if (modifiers & ECORE_EVENT_LOCK_NUM) 315 if (modifiers & ECORE_EVENT_LOCK_NUM)
315 evas_key_lock_on(e, "Num_Lock"); 316 evas_seat_key_lock_on(e, "Num_Lock", seat);
316 else evas_key_lock_off(e, "Num_Lock"); 317 else evas_seat_key_lock_off(e, "Num_Lock", seat);
317 318
318 if (modifiers & ECORE_EVENT_LOCK_CAPS) 319 if (modifiers & ECORE_EVENT_LOCK_CAPS)
319 evas_key_lock_on(e, "Caps_Lock"); 320 evas_seat_key_lock_on(e, "Caps_Lock", seat);
320 else evas_key_lock_off(e, "Caps_Lock"); 321 else evas_seat_key_lock_off(e, "Caps_Lock", seat);
321 322
322 if (modifiers & ECORE_EVENT_LOCK_SHIFT) 323 if (modifiers & ECORE_EVENT_LOCK_SHIFT)
323 evas_key_lock_on(e, "Shift_Lock"); 324 evas_seat_key_lock_on(e, "Shift_Lock", seat);
324 else evas_key_lock_off(e, "Shift_Lock"); 325 else evas_seat_key_lock_off(e, "Shift_Lock", seat);
326}
327
328EAPI void
329ecore_event_evas_modifier_lock_update(Evas *e, unsigned int modifiers)
330{
331 ecore_event_evas_seat_modifier_lock_update(e, modifiers, NULL);
325} 332}
326 333
327EAPI void 334EAPI void
@@ -412,7 +419,9 @@ _ecore_event_evas_key(Ecore_Event_Key *e, Ecore_Event_Press press)
412 419
413 lookup = _ecore_event_window_match(e->event_window); 420 lookup = _ecore_event_window_match(e->event_window);
414 if (!lookup) return ECORE_CALLBACK_PASS_ON; 421 if (!lookup) return ECORE_CALLBACK_PASS_ON;
415 ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers); 422 ecore_event_evas_seat_modifier_lock_update(lookup->evas,
423 e->modifiers,
424 efl_input_device_seat_get(e->dev));
416 if (press == ECORE_DOWN) 425 if (press == ECORE_DOWN)
417 { 426 {
418 if (!lookup->direct || 427 if (!lookup->direct ||
@@ -521,7 +530,9 @@ _ecore_event_evas_mouse_button(Ecore_Event_Mouse_Button *e, Ecore_Event_Press pr
521 530
522 if (e->multi.device == 0) 531 if (e->multi.device == 0)
523 { 532 {
524 ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers); 533 ecore_event_evas_seat_modifier_lock_update(lookup->evas,
534 e->modifiers,
535 efl_input_device_seat_get(e->dev));
525 if (press == ECORE_DOWN) 536 if (press == ECORE_DOWN)
526 { 537 {
527 if (!lookup->direct || 538 if (!lookup->direct ||
@@ -601,7 +612,9 @@ ecore_event_evas_mouse_move(void *data EINA_UNUSED, int type EINA_UNUSED, void *
601 if (e->multi.device == 0) 612 if (e->multi.device == 0)
602 { 613 {
603 _ecore_event_evas_push_mouse_move(e); 614 _ecore_event_evas_push_mouse_move(e);
604 ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers); 615 ecore_event_evas_seat_modifier_lock_update(lookup->evas,
616 e->modifiers,
617 efl_input_device_seat_get(e->dev));
605 if (!lookup->direct || 618 if (!lookup->direct ||
606 !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_MOVE, e)) 619 !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_MOVE, e))
607 { 620 {
@@ -660,7 +673,9 @@ _ecore_event_evas_mouse_io(Ecore_Event_Mouse_IO *e, Ecore_Event_IO io)
660 673
661 lookup = _ecore_event_window_match(e->event_window); 674 lookup = _ecore_event_window_match(e->event_window);
662 if (!lookup) return ECORE_CALLBACK_PASS_ON; 675 if (!lookup) return ECORE_CALLBACK_PASS_ON;
663 ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers); 676 ecore_event_evas_seat_modifier_lock_update(lookup->evas,
677 e->modifiers,
678 efl_input_device_seat_get(e->dev));
664 switch (io) 679 switch (io)
665 { 680 {
666 case ECORE_IN: 681 case ECORE_IN:
@@ -706,7 +721,8 @@ ecore_event_evas_mouse_wheel(void *data EINA_UNUSED, int type EINA_UNUSED, void
706 e = event; 721 e = event;
707 lookup = _ecore_event_window_match(e->event_window); 722 lookup = _ecore_event_window_match(e->event_window);
708 if (!lookup) return ECORE_CALLBACK_PASS_ON; 723 if (!lookup) return ECORE_CALLBACK_PASS_ON;
709 ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers); 724 ecore_event_evas_seat_modifier_lock_update(lookup->evas, e->modifiers,
725 efl_input_device_seat_get(e->dev));
710 if (!lookup->direct || 726 if (!lookup->direct ||
711 !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_WHEEL, e)) 727 !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_WHEEL, e))
712 { 728 {