Use a full enum for the modifier masks

This commit is contained in:
Emmanuele Bassi 2007-06-11 09:02:28 +00:00
parent 5997230fb2
commit a8c3d1652b
2 changed files with 22 additions and 12 deletions

View File

@ -248,14 +248,18 @@ clutter_key_event_unicode (ClutterKeyEvent *keyev)
{
g_return_val_if_fail (keyev != NULL, 0);
return clutter_keysym_to_unicode (keyev->keyval);
if ((keyev->modifier_state & CLUTTER_SHIFT_MASK) ||
(keyev->modifier_state & CLUTTER_LOCK_MASK))
return g_unichar_toupper (clutter_keysym_to_unicode (keyev->keyval));
else
return clutter_keysym_to_unicode (keyev->keyval);
}
/**
* clutter_keysym_to_unicode:
* @keyval: a clutter key symbol
*
* Convert from a GDK key symbol to the corresponding ISO10646 (Unicode)
* Convert from a Clutter key symbol to the corresponding ISO10646 (Unicode)
* character.
*
* Return value: the corresponding unicode character, or 0 if there

View File

@ -34,15 +34,21 @@
G_BEGIN_DECLS
enum
{
/* Map to xlibs masks */
CLUTTER_BUTTON1_MASK = (1 << 8),
CLUTTER_BUTTON2_MASK = (1 << 9),
CLUTTER_BUTTON3_MASK = (1 << 10),
CLUTTER_BUTTON4_MASK = (1 << 11),
CLUTTER_BUTTON5_MASK = (1 << 12)
};
typedef enum {
CLUTTER_SHIFT_MASK = 1 << 0,
CLUTTER_LOCK_MASK = 1 << 1,
CLUTTER_CONTROL_MASK = 1 << 2,
CLUTTER_MOD1_MASK = 1 << 3,
CLUTTER_MOD2_MASK = 1 << 4,
CLUTTER_MOD3_MASK = 1 << 5,
CLUTTER_MOD4_MASK = 1 << 6,
CLUTTER_MOD5_MASK = 1 << 7,
CLUTTER_BUTTON1_MASK = 1 << 8,
CLUTTER_BUTTON2_MASK = 1 << 9,
CLUTTER_BUTTON3_MASK = 1 << 10,
CLUTTER_BUTTON4_MASK = 1 << 11,
CLUTTER_BUTTON5_MASK = 1 << 12
} ClutterModifierType;
typedef enum
{