Add functionality for setting left handed mode in drm

Summary:
 - Change mouse button mapping for left handed mode
 - Change a mouse_hand config and save
 Currently e_mouse had e_mouse_update() API for support left_handed mode.
 But that API only for Xorg not support wayland and only for update mapping not change mapping.
 So I added new support for change mouse mapping for left handed mode and support wayland backend system.

Test Plan:
After set left handed mode,
           mouse button mapping is changed for left handed people.

Reviewers: raster, devilhorns, zmike

Subscribers: ohduna, input.hacker, cedric

Differential Revision: https://phab.enlightenment.org/D3433
This commit is contained in:
JengHyun Kang 2016-03-23 17:55:09 -04:00 committed by Mike Blumenkrantz
parent 5d27befe44
commit 3cdc11a107
1 changed files with 15 additions and 1 deletions

View File

@ -1,4 +1,7 @@
#include "e.h"
#ifdef HAVE_WL_DRM
#include <Ecore_Drm.h>
#endif
E_API int
e_mouse_update(void)
@ -41,7 +44,18 @@ e_mouse_update(void)
if (!ecore_x_pointer_mapping_set(map, n)) return 0;
}
#endif
#ifdef HAVE_WL_DRM
if (strstr(ecore_evas_engine_name_get(e_comp->ee), "drm"))
{
const Eina_List *list, *l;
Ecore_Drm_Device *dev;
list = ecore_drm_devices_get();
EINA_LIST_FOREACH(list, l, dev)
{
ecore_drm_device_pointer_left_handed_set(dev, (Eina_Bool)!e_config->mouse_hand);
}
}
#endif
return 1;
}