diff options
author | Sung-Jin Park <input.hacker@gmail.com> | 2015-12-28 09:18:05 -0500 |
---|---|---|
committer | Chris Michael <cpmichael@osg.samsung.com> | 2015-12-28 09:24:58 -0500 |
commit | 936350d37fd7d2ba695584db079cfc98eb13faed (patch) | |
tree | ead2459b3db125eb383b9b2d9b0d387b7a1ea5c2 /src/lib/ecore_drm/Ecore_Drm.h | |
parent | d91e403a98f5343b31aaaa2bda2e24cf27156cf8 (diff) |
ecore-drm: Add APIs to support key remap functionality
Summary:
This adds two new APIs to enable/set key remap functionality and
a number of keys to be remapped to the other keys. As of now there is no
api to do this therefore we need to remap using linux utility such as
'setkeycodes'. By adding/calling these apis, each Ecore_Drm_Evdev device
will have its specific key remap hash and we can apply each remapping keys
for each key/keyboard device.
Test Plan:
(1) Enable key remap and set remapping of a key on a specific keyboard device
(2) Plug in the keyboard device and check the key is being remapped or not
(3) Check the other keys are coming normally
(4) Check the the remapping key on a specific keyboard doesn't affect to any other devices
Signed-off-by: Sung-Jin Park <input.hacker@gmail.com>
Reviewers: raster, zmike, gwanglim, ManMower, devilhorns
Subscribers: JHyun, ohduna, cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D3463
Diffstat (limited to 'src/lib/ecore_drm/Ecore_Drm.h')
-rw-r--r-- | src/lib/ecore_drm/Ecore_Drm.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/lib/ecore_drm/Ecore_Drm.h b/src/lib/ecore_drm/Ecore_Drm.h index 47c60048cf..b7dccce576 100644 --- a/src/lib/ecore_drm/Ecore_Drm.h +++ b/src/lib/ecore_drm/Ecore_Drm.h | |||
@@ -940,6 +940,41 @@ EAPI Eina_Bool ecore_drm_output_possible_crtc_get(Ecore_Drm_Output *output, unsi | |||
940 | */ | 940 | */ |
941 | EAPI Eina_Bool ecore_drm_output_mode_set(Ecore_Drm_Output *output, Ecore_Drm_Output_Mode *mode, int x, int y); | 941 | EAPI Eina_Bool ecore_drm_output_mode_set(Ecore_Drm_Output *output, Ecore_Drm_Output_Mode *mode, int x, int y); |
942 | 942 | ||
943 | /** | ||
944 | * Enable key remap functionality on a Ecore_Drm_Evdev | ||
945 | * | ||
946 | * This function will enable the key remap functionality to the given Ecore_Drm_Evdev | ||
947 | * | ||
948 | * @param edev The Ecore_Drm_Evdev to enable the key remap on | ||
949 | * @param enable A valid Eina_Bool to enable or disable the key remap on the device | ||
950 | * | ||
951 | * @return EINA_FALSE is returned if the Ecore_Drm_Evdev is not valid, or if no libinput device has been | ||
952 | * assigned to it yet. EINA_TRUE will be returned if enabling key remap for this device succeeded. | ||
953 | * | ||
954 | * @ingroup Ecore_Drm_Input_Group | ||
955 | * @since 1.17 | ||
956 | */ | ||
957 | EAPI Eina_Bool ecore_drm_evdev_key_remap_enable(Ecore_Drm_Evdev *edev, Eina_Bool enable); | ||
958 | |||
959 | /** | ||
960 | * Set a given set of keys as remapped keys on a Ecore_Drm_Evdev | ||
961 | * | ||
962 | * This function will create a hash table of remapping keys as a member of the given Ecore_Drm_Evdev | ||
963 | * | ||
964 | * @param edev The Ecore_Drm_Evdev to set the remapping keys on | ||
965 | * @param from_keys A set of keycodes which contains the original keycode | ||
966 | * @param to_keys A set of keycodes which contains the keycode to be remapped | ||
967 | * @param num The number of keys to be applied | ||
968 | * | ||
969 | * @return EINA_FALSE is returned if the Ecore_Drm_Evdev is not valid, if no libinput device has been | ||
970 | * assigned to it yet, if key remap is not enabled yet, or the some of the given parameters such as | ||
971 | * from_keys, to_keys, num are not valid. EINA_TRUE will be returned if setting key remap for this device succeeded. | ||
972 | * | ||
973 | * @ingroup Ecore_Drm_Input_Group | ||
974 | * @since 1.17 | ||
975 | */ | ||
976 | EAPI Eina_Bool ecore_drm_evdev_key_remap_set(Ecore_Drm_Evdev *edev, int *from_keys, int *to_keys, int num); | ||
977 | |||
943 | # ifdef __cplusplus | 978 | # ifdef __cplusplus |
944 | } | 979 | } |
945 | # endif | 980 | # endif |