ecore-x: add ecore_x_keysym_get()

this is a less invasive solution for retrieving a keysym. X keysyms are
not portable, and so this function should not be used for any code which
is meant to run on other platforms.

@feature
This commit is contained in:
Mike Blumenkrantz 2015-06-29 13:09:56 -04:00
parent 4d41778251
commit 476ebdc0a1
3 changed files with 22 additions and 0 deletions

View File

@ -2520,6 +2520,16 @@ EAPI const char *ecore_x_keysym_string_get(int keysym);
*/
EAPI int ecore_x_keysym_keycode_get(const char *keyname);
/**
* Return the X-specific keysym for a given key string
* @param string The key to get the keysym for
* @return the keysym value
*
* @since 1.15
* @note The returned value is not portable.
*/
EAPI unsigned int ecore_x_keysym_get(const char *string);
typedef struct _Ecore_X_Image Ecore_X_Image;
EAPI Ecore_X_Image *ecore_x_image_new(int w, int h, Ecore_X_Visual vis, int depth);

View File

@ -330,6 +330,12 @@ ecore_x_keysym_keycode_get(const char *keyname)
return _ecore_xcb_keymap_string_to_keycode(keyname);
}
EAPI unsigned int
ecore_x_keysym_get(const char *string)
{
return _ecore_xcb_keymap_string_to_keysym(string);
}
/* local functions */
static int
_ecore_xcb_keymap_mask_get(void *reply,

View File

@ -165,3 +165,9 @@ ecore_x_keysym_keycode_get(const char *keyname)
return keycode;
}
EAPI unsigned int
ecore_x_keysym_get(const char *string)
{
return XStringToKeysym(string);
}