Key Input Functions

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

Functions
Key Input Functions
Evas » Canvas Functions

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

## Functions
Eina_Bool | evas_key_modifier_is_set (const Evas_Modifier *m, const char *keyname)
| Checks the state of a given modifier key, at the time of the call. More...
Eina_Bool | evas_key_lock_is_set (const Evas_Lock *l, const char *keyname)
| Checks the state of a given lock key, at the time of the call. More...

## Detailed Description

Functions which 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.

## Function Documentation

Eina_Bool evas_key_modifier_is_set | ( | const Evas_Modifier * | m,
|  | const char * | keyname
| ) |  |

Checks the state of a given modifier key, 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

Eina_Bool evas_key_lock_is_set | ( | const Evas_Lock * | l,
|  | const char * | keyname
| ) |  |

Checks the state of a given lock key, 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