Gdk.Display.translate_key

### Method

# Gdk Displaytranslate_key

#### Declaration [src]

    gboolean
    gdk_display_translate_key (
      GdkDisplay* display,
      guint keycode,
      GdkModifierType state,
      int group,
      guint* keyval,
      int* effective_group,
      int* level,
      GdkModifierType* consumed
    )

#### Description [src]

Translates the contents of a `GdkEventKey` into a keyval, effective group, and level.

Modifiers that affected the translation and are thus unavailable for application use are returned in `consumed_modifiers`.

The `effective_group` is the group that was actually used for the translation; some keys such as Enter are not affected by the active keyboard group. The `level` is derived from `state`.

`consumed_modifiers` gives modifiers that should be masked out from `state` when comparing this key press to a keyboard shortcut. For instance, on a US keyboard, the `plus` symbol is shifted, so when comparing a key press to a `<Control>plus` accelerator `<Shift>` should be masked out.

This function should rarely be needed, since `GdkEventKey` already contains the translated keyval. It is exported for the benefit of virtualized test environments.

#### Parameters

`keycode`

  Type: `guint`

  A keycode.

`state`

  Type: `GdkModifierType`

  A modifier state.

`group`

  Type: `int`

  Active keyboard group.

`keyval`

  Type: `guint*`

  Return location for keyval.

  The argument will be set by the function.
  The argument can be `NULL`.

`effective_group`

  Type: `int*`

  Return location for effective group.

  The argument will be set by the function.
  The argument can be `NULL`.

`level`

  Type: `int*`

  Return location for level.

  The argument will be set by the function.
  The argument can be `NULL`.

`consumed`

  Type: `GdkModifierType`

  Return location for modifiers that were used to determine the group or level.

  The argument will be set by the function.
  The argument can be `NULL`.
  The instance takes ownership of the data, and is responsible for freeing it.

#### Return value

Type: `gboolean`

`TRUE` if there was a keyval bound to keycode/state/group.