forked from enlightenment/efl
Ecore_X: Add api function (and code) to retrieve actual keycode from
keyname (needed to handle input from x11 to wayland clients). SVN revision: 67591
This commit is contained in:
parent
7dbd7c03e6
commit
3beb6bb400
|
@ -3408,6 +3408,13 @@ EAPI Eina_Bool
|
|||
EAPI const char *
|
||||
ecore_x_keysym_string_get(int keysym);
|
||||
|
||||
/**
|
||||
* Given a keyname, return the keycode representing that key
|
||||
*
|
||||
* @since 1.2.0
|
||||
*/
|
||||
EAPI int ecore_x_keysym_keycode_get(const char *keyname);
|
||||
|
||||
typedef struct _Ecore_X_Image Ecore_X_Image;
|
||||
|
||||
EAPI Ecore_X_Image *
|
||||
|
|
|
@ -279,6 +279,14 @@ ecore_x_keysym_string_get(int keysym)
|
|||
return _ecore_xcb_keymap_keysym_to_string(keysym);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
ecore_x_keysym_keycode_get(const char *keyname)
|
||||
{
|
||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||
|
||||
return _ecore_xcb_keymap_string_to_keycode(keyname);
|
||||
}
|
||||
|
||||
/* local functions */
|
||||
static int
|
||||
_ecore_xcb_keymap_mask_get(void *reply,
|
||||
|
|
|
@ -153,3 +153,15 @@ ecore_x_keysym_string_get(int keysym)
|
|||
return XKeysymToString(keysym);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
ecore_x_keysym_keycode_get(const char *keyname)
|
||||
{
|
||||
int keycode = 0;
|
||||
|
||||
if (!strncmp(keyname, "Keycode-", 8))
|
||||
keycode = atoi(keyname + 8);
|
||||
else
|
||||
keycode = XKeysymToKeycode(_ecore_x_disp, XStringToKeysym(keyname));
|
||||
|
||||
return keycode;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue