forked from enlightenment/efl
ecore_x: XKeycodeToKeysym
ecore_x is calling XKeycodeToKeysym from xlib, but this function has issues. It has been deprecated 6 months ago in X.org and it is suggested to use XkbKeycodeToKeysym instead: https://bugs.freedesktop.org/show_bug.cgi?id=25732 This commit makes a wrapper function that makes use of XkbKeycodeToKeysym when possible or fallback to XKeycodeToKeysym otherwise. SVN revision: 71677
This commit is contained in:
parent
b0e087b6bf
commit
ac27c27083
|
@ -211,6 +211,16 @@ _XReply(Display *disp,
|
||||||
|
|
||||||
#endif /* ifdef LOGRT */
|
#endif /* ifdef LOGRT */
|
||||||
|
|
||||||
|
/* wrapper to use XkbKeycodeToKeysym when possible */
|
||||||
|
KeySym
|
||||||
|
_ecore_x_XKeycodeToKeysym(Display *display, KeyCode keycode, int index)
|
||||||
|
{
|
||||||
|
#ifdef ECORE_XKB
|
||||||
|
return XkbKeycodeToKeysym(display, keycode, 0, index);
|
||||||
|
#endif
|
||||||
|
return XKeycodeToKeysym(display, keycode, index);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_ecore_x_modifiers_get(void)
|
_ecore_x_modifiers_get(void)
|
||||||
{
|
{
|
||||||
|
@ -1056,7 +1066,8 @@ _ecore_x_key_mask_get(KeySym sym)
|
||||||
{
|
{
|
||||||
for (j = 0; j < 8; j++)
|
for (j = 0; j < 8; j++)
|
||||||
{
|
{
|
||||||
sym2 = XKeycodeToKeysym(_ecore_x_disp, mod->modifiermap[i], j);
|
sym2 = _ecore_x_XKeycodeToKeysym(_ecore_x_disp,
|
||||||
|
mod->modifiermap[i], j);
|
||||||
if (sym2 != 0)
|
if (sym2 != 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -278,7 +278,7 @@ _ecore_key_press(int event,
|
||||||
int val;
|
int val;
|
||||||
|
|
||||||
_ecore_x_last_event_mouse_move = 0;
|
_ecore_x_last_event_mouse_move = 0;
|
||||||
keyname = XKeysymToString(XKeycodeToKeysym(xevent->display,
|
keyname = XKeysymToString(_ecore_x_XKeycodeToKeysym(xevent->display,
|
||||||
xevent->keycode, 0));
|
xevent->keycode, 0));
|
||||||
if (!keyname)
|
if (!keyname)
|
||||||
{
|
{
|
||||||
|
|
|
@ -372,6 +372,7 @@ Ecore_Event_Mouse_Button *_ecore_mouse_button(int event,
|
||||||
double mry);
|
double mry);
|
||||||
|
|
||||||
void _ecore_x_modifiers_get(void);
|
void _ecore_x_modifiers_get(void);
|
||||||
|
KeySym _ecore_x_XKeycodeToKeysym(Display *display, KeyCode keycode, int index);
|
||||||
|
|
||||||
//#define LOGFNS 1
|
//#define LOGFNS 1
|
||||||
|
|
||||||
|
|
|
@ -98,9 +98,9 @@ ecore_x_test_fake_key_press(const char *key __UNUSED__)
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
|
|
||||||
keycode = XKeysymToKeycode(_ecore_x_disp, keysym);
|
keycode = XKeysymToKeycode(_ecore_x_disp, keysym);
|
||||||
if (XKeycodeToKeysym(_ecore_x_disp, keycode, 0) != keysym)
|
if (_ecore_x_XKeycodeToKeysym(_ecore_x_disp, keycode, 0) != keysym)
|
||||||
{
|
{
|
||||||
if (XKeycodeToKeysym(_ecore_x_disp, keycode, 1) == keysym)
|
if (_ecore_x_XKeycodeToKeysym(_ecore_x_disp, keycode, 1) == keysym)
|
||||||
shift = 1;
|
shift = 1;
|
||||||
else
|
else
|
||||||
keycode = 0;
|
keycode = 0;
|
||||||
|
|
Loading…
Reference in New Issue