Key Input Functions

- Main Page
- Related Pages
- Modules
- Data Structures
- Files
- Examples

Typedefs | Functions
Key Input Functions
Evas » Canvas Functions

Functions that feed key events to the canvas. More...

## Typedefs
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.

## Functions
EVAS_API 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.
EVAS_API Eina_Bool | evas_seat_key_modifier_is_set (const Evas_Modifier *m, const char *keyname, const Evas_Device *seat)
| Checks the state of a given modifier key of a given seat, at the time of the call.
EVAS_API 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.
EVAS_API Eina_Bool | evas_seat_key_lock_is_set (const Evas_Lock *l, const char *keyname, const Evas_Device *seat)
| Checks the state of a given lock key of a given seat, at the time of the call.

## Detailed Description

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 */
{
evas_key_modifier_get
EVAS_API const Evas_Modifier * evas_key_modifier_get(const Evas *eo_e)
Returns a handle to the list of modifier keys registered in the canvas e.
Definition: evas_key.c:35
evas_key_modifier_is_set
EVAS_API 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.
Definition: evas_key.c:76

All the other `evas_key` functions behave on the same manner. See the full example.

## Typedef Documentation

## ◆ Evas_Modifier_Mask

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

## ◆ evas_key_modifier_is_set()

EVAS_API 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 named `keyname` 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

References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, and evas_seat_key_modifier_is_set().

## ◆ evas_seat_key_modifier_is_set()

EVAS_API Eina_Bool evas_seat_key_modifier_is_set | ( | const Evas_Modifier * | m,
|  | const char * | keyname,
|  | const Evas_Device * | seat
| ) |  |

Checks the state of a given modifier key of a given 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.
  seat | The seat to check if the lock is set. Use `NULL` for the default seat.

Returns
  `Eina_True` if the modifier key named `keyname` 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_on
  evas_seat_key_modifier_off
  evas_key_modifier_is_set

Since
  1.19

References EINA_FALSE, and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by evas_key_modifier_is_set().

## ◆ evas_key_lock_is_set()

EVAS_API 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 the `keyname` 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

References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, and evas_seat_key_lock_is_set().

## ◆ evas_seat_key_lock_is_set()

EVAS_API Eina_Bool evas_seat_key_lock_is_set | ( | const Evas_Lock * | l,
|  | const char * | keyname,
|  | const Evas_Device * | seat
| ) |  |

Checks the state of a given lock key of a given 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.
  seat | The seat to check if the lock is set. Use `NULL` for the default seat.

Returns
  `Eina_True` if the `keyname` 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_key_lock_is_set

Since
  1.19

References EINA_FALSE, and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by evas_key_lock_is_set().