ECORE_IMF_KEYBOARD_MODIFIER_CTRL = 1 << 0, /**< "Control" is pressed */
ECORE_IMF_KEYBOARD_MODIFIER_ALT = 1 << 1, /**< "Alt" is pressed */
ECORE_IMF_KEYBOARD_MODIFIER_SHIFT = 1 << 2, /**< "Shift" is pressed */
- ECORE_IMF_KEYBOARD_MODIFIER_WIN = 1 << 3 /**< "Win" (between "Ctrl" and "Alt") is pressed */
+ ECORE_IMF_KEYBOARD_MODIFIER_WIN = 1 << 3, /**< "Win" (between "Ctrl" and "Alt") is pressed */
+ ECORE_IMF_KEYBOARD_MODIFIER_MODE = 1 << 4 /**< "AltGr" is pressed @since 1.3 */
} Ecore_IMF_Keyboard_Modifiers;
/**
*imf_keyboard_modifiers |= ECORE_IMF_KEYBOARD_MODIFIER_SHIFT;
if (evas_key_modifier_is_set(evas_modifiers, "Super") || evas_key_modifier_is_set(evas_modifiers, "Hyper"))
*imf_keyboard_modifiers |= ECORE_IMF_KEYBOARD_MODIFIER_WIN;
+ if (evas_key_modifier_is_set(evas_modifiers, "Mode"))
+ *imf_keyboard_modifiers |= ECORE_IMF_KEYBOARD_MODIFIER_MODE;
}
/* Converts the Evas locks to Ecore_IMF keyboard locks */
#define ECORE_EVENT_LOCK_NUM 0x0100
#define ECORE_EVENT_LOCK_CAPS 0x0200
#define ECORE_EVENT_LOCK_SHIFT 0x0300
+#define ECORE_EVENT_MODIFIER_MODE 0x0400 /**< @since 1.3 */
typedef uintptr_t Ecore_Window;
typedef struct _Ecore_Event_Key Ecore_Event_Key;
ECORE_WIN,
ECORE_SCROLL,
ECORE_CAPS,
+ ECORE_MODE, /**< @since 1.3 */
ECORE_LAST
} Ecore_Event_Modifier;
{ "Caps_Lock", ECORE_CAPS, ECORE_EVENT_MODIFIER_CAPS },
{ "Super_L", ECORE_WIN, ECORE_EVENT_MODIFIER_WIN },
{ "Super_R", ECORE_WIN, ECORE_EVENT_MODIFIER_WIN },
+ { "ISO_Level3_Shift", ECORE_MODE, ECORE_EVENT_MODIFIER_MODE },
{ "Scroll_Lock", ECORE_SCROLL, ECORE_EVENT_MODIFIER_SCROLL }
};
evas_key_modifier_off(e, "Hyper");
}
+ if (modifiers & ECORE_EVENT_MODIFIER_MODE)
+ evas_key_modifier_on(e, "Mode");
+ else evas_key_modifier_off(e, "Mode");
+
if (modifiers & ECORE_EVENT_LOCK_SCROLL)
evas_key_lock_on(e, "Scroll_Lock");
else evas_key_lock_off(e, "Scroll_Lock");
evas_key_modifier_add(evas, "Meta");
evas_key_modifier_add(evas, "Hyper");
evas_key_modifier_add(evas, "Super");
+ evas_key_modifier_add(evas, "Mode");
evas_key_lock_add(evas, "Caps_Lock");
evas_key_lock_add(evas, "Num_Lock");
evas_key_lock_add(evas, "Scroll_Lock");
modifiers |= ECORE_EVENT_MODIFIER_ALT;
if (state & ECORE_X_MODIFIER_WIN)
modifiers |= ECORE_EVENT_MODIFIER_WIN;
+ if (state & ECORE_X_MODIFIER_MODE)
+ modifiers |= ECORE_EVENT_MODIFIER_MODE;
if (state & ECORE_X_LOCK_SCROLL)
modifiers |= ECORE_EVENT_LOCK_SCROLL;
if (state & ECORE_X_LOCK_CAPS)
EAPI int ECORE_X_MODIFIER_CTRL = 0;
EAPI int ECORE_X_MODIFIER_ALT = 0;
EAPI int ECORE_X_MODIFIER_WIN = 0;
+EAPI int ECORE_X_MODIFIER_MODE = 0;
EAPI int ECORE_X_LOCK_SCROLL = 0;
EAPI int ECORE_X_LOCK_NUM = 0;
EAPI int ECORE_X_LOCK_CAPS = 0;
ECORE_X_MODIFIER_WIN = _ecore_xcb_keymap_mask_get(reply, XK_Super_L);
if (!ECORE_X_MODIFIER_WIN)
- ECORE_X_MODIFIER_WIN = _ecore_xcb_keymap_mask_get(reply, XK_Mode_switch);
- if (!ECORE_X_MODIFIER_WIN)
ECORE_X_MODIFIER_WIN = _ecore_xcb_keymap_mask_get(reply, XK_Meta_L);
+ ECORE_X_MODIFIER_MODE = _ecore_xcb_keymap_mask_get(reply, XK_Mode_switch);
+
if (ECORE_X_MODIFIER_WIN == ECORE_X_MODIFIER_ALT)
ECORE_X_MODIFIER_WIN = 0;
if (ECORE_X_MODIFIER_ALT == ECORE_X_MODIFIER_CTRL)
extern int ECORE_X_MODIFIER_CTRL;
extern int ECORE_X_MODIFIER_ALT;
extern int ECORE_X_MODIFIER_WIN;
+extern int ECORE_X_MODIFIER_MODE;
extern int ECORE_X_LOCK_SCROLL;
extern int ECORE_X_LOCK_NUM;
extern int ECORE_X_LOCK_CAPS;
xmodifiers |= ECORE_X_MODIFIER_ALT;
if (state & ECORE_EVENT_MODIFIER_WIN)
xmodifiers |= ECORE_X_MODIFIER_WIN;
+ if (state & ECORE_EVENT_MODIFIER_MODE)
+ xmodifiers |= ECORE_X_MODIFIER_MODE;
if (state & ECORE_EVENT_LOCK_SCROLL)
xmodifiers |= ECORE_X_LOCK_SCROLL;
if (state & ECORE_EVENT_LOCK_NUM)
int ECORE_X_MODIFIER_CTRL = 0;
int ECORE_X_MODIFIER_ALT = 0;
int ECORE_X_MODIFIER_WIN = 0;
+int ECORE_X_MODIFIER_MODE = 0;
EAPI int ECORE_X_LOCK_SCROLL = 0;
EAPI int ECORE_X_LOCK_NUM = 0;
{
#ifdef ECORE_XKB
return XkbKeycodeToKeysym(display, keycode, 0, idx);
-#endif
+#else
return XKeycodeToKeysym(display, keycode, idx);
+#endif
}
void
/* the windows key... a valid modifier :) */
ECORE_X_MODIFIER_WIN = _ecore_x_key_mask_get(XK_Super_L);
if (!ECORE_X_MODIFIER_WIN)
- ECORE_X_MODIFIER_WIN = _ecore_x_key_mask_get(XK_Mode_switch);
-
- if (!ECORE_X_MODIFIER_WIN)
ECORE_X_MODIFIER_WIN = _ecore_x_key_mask_get(XK_Meta_L);
+ ECORE_X_MODIFIER_MODE = _ecore_x_key_mask_get(XK_Mode_switch);
+
if (ECORE_X_MODIFIER_WIN == ECORE_X_MODIFIER_ALT)
ECORE_X_MODIFIER_WIN = 0;
if (state & ECORE_EVENT_MODIFIER_WIN)
xmodifiers |= ECORE_X_MODIFIER_WIN;
+ if (state & ECORE_EVENT_MODIFIER_MODE)
+ xmodifiers |= ECORE_X_MODIFIER_MODE;
+
if (state & ECORE_EVENT_LOCK_SCROLL)
xmodifiers |= ECORE_X_LOCK_SCROLL;
if (state & ECORE_X_MODIFIER_WIN)
modifiers |= ECORE_EVENT_MODIFIER_WIN;
+ if (state & ECORE_X_MODIFIER_MODE)
+ modifiers |= ECORE_EVENT_MODIFIER_MODE;
+
if (state & ECORE_X_LOCK_SCROLL)
modifiers |= ECORE_EVENT_LOCK_SCROLL;
extern int ECORE_X_MODIFIER_CTRL;
extern int ECORE_X_MODIFIER_ALT;
extern int ECORE_X_MODIFIER_WIN;
+extern int ECORE_X_MODIFIER_MODE;
extern int ECORE_X_LOCK_SCROLL;
extern int ECORE_X_LOCK_NUM;
if (state & ECORE_IMF_KEYBOARD_MODIFIER_SHIFT)
modifiers |= ShiftMask;
- /**< "Win" (between "Ctrl" and "A */
+ /**< "Win" (between "Ctrl" and "Alt") is pressed */
if (state & ECORE_IMF_KEYBOARD_MODIFIER_WIN)
+ modifiers |= Mod4Mask;
+
+ /**< "AltGr" is pressed */
+ if (state & ECORE_IMF_KEYBOARD_MODIFIER_MODE)
modifiers |= Mod5Mask;
return modifiers;