Tizen Native API
5.5
|
Functions that feed key events to the canvas.
As explained in intro_not_evas, Evas is not aware of input systems at all. Then, the user, if using it crudely (evas_new()), will have to feed it with input events, so that it can react somehow. If, however, the user creates a canvas by means of the Ecore_Evas wrapper, it will automatically bind the chosen display engine's input events to the canvas, for you.
This group presents the functions dealing with the feeding of key events to the canvas. On most of them, one has to reference a given key by a name (keyname
argument). Those are platform dependent symbolic names for the keys. Sometimes you'll get the right keyname
by simply using an ASCII value of the key name, but it won't be like that always.
Typical platforms are Linux frame buffer (Ecore_FB) and X server (Ecore_X) when using Evas with Ecore and Ecore_Evas. Please refer to your display engine's documentation when using evas through an Ecore helper wrapper when you need the keyname
s.
Example:
mods = evas_key_modifier_get(evas); if (evas_key_modifier_is_set(mods, "Control") && (strcmp(ev->key, "o") == 0)) /* add an obscured * rectangle to the middle * of the canvas */ {
All the other evas_key
functions behave on the same manner. See the full example.
Functions | |
Eina_Bool | evas_key_modifier_is_set (const Evas_Modifier *m, const char *keyname) |
Eina_Bool | evas_key_lock_is_set (const Evas_Lock *l, const char *keyname) |
Typedefs | |
typedef struct _Evas_Lock | Evas_Lock |
typedef struct _Evas_Modifier | Evas_Modifier |
typedef unsigned long long | Evas_Modifier_Mask |
Typedef Documentation
typedef struct _Evas_Lock Evas_Lock |
An opaque type containing information on which lock keys are registered in an Evas canvas.
typedef struct _Evas_Modifier Evas_Modifier |
An opaque type containing information on which modifier keys are registered in an Evas canvas.
typedef unsigned long long Evas_Modifier_Mask |
A bitmask of modifier keys.
See evas_key_modifier_mask_get() for the keyname to bit conversion.
Function Documentation
Eina_Bool evas_key_lock_is_set | ( | const Evas_Lock * | l, |
const char * | keyname | ||
) |
Checks the state of a given lock key of the default seat, at the time of the call. If the lock is set, such as caps lock, this function returns Eina_True
.
- Parameters:
-
l The current locks set, as returned by evas_key_lock_get(). keyname The name of the lock key to check status for.
- Returns:
Eina_True
if thekeyname
lock key is set,Eina_False
otherwise.
- See also:
- evas_key_lock_get
- evas_key_lock_add
- evas_key_lock_del
- evas_key_lock_on
- evas_key_lock_off
- evas_seat_key_lock_on
- evas_seat_key_lock_off
- evas_seat_key_lock_is_set
- Since :
- 2.3
Eina_Bool evas_key_modifier_is_set | ( | const Evas_Modifier * | m, |
const char * | keyname | ||
) |
Checks the state of a given modifier of the default seat, at the time of the call. If the modifier is set, such as shift being pressed, this function returns Eina_True
.
- Parameters:
-
m The current modifiers set, as returned by evas_key_modifier_get(). keyname The name of the modifier key to check status for.
- Returns:
Eina_True
if the modifier key namedkeyname
is on,Eina_False
otherwise.
- See also:
- evas_key_modifier_add
- evas_key_modifier_del
- evas_key_modifier_get
- evas_key_modifier_on
- evas_key_modifier_off
- evas_seat_key_modifier_is_set
- Since :
- 2.3
- Examples:
- ecore_imf_example.c, edje-box2.c, evas-aspect-hints.c, evas-box.c, evas-events.c, evas-hints.c, and web_example_02.c.