### Signal

# Gtk EventControllerKey::key-pressed

since: 4.0

#### Declaration

    gboolean
    key_pressed (
      GtkEventControllerKey* self,
      guint keyval,
      guint keycode,
      GdkModifierType state,
      gpointer user_data
    )

#### Description [src]

Emitted whenever a key is pressed.

Default handler: The default handler is called after the handlers added via `g_signal_connect()`.
Available since: 4.0

#### Parameters

`keyval`

  Type: `guint`

  The pressed key.

`keycode`

  Type: `guint`

  The raw code of the pressed key.

`state`

  Type: `GdkModifierType`

  The bitmask, representing the state of modifier keys and pointer buttons.

#### Return value

Type: `gboolean`

`TRUE` if the key press was handled, `FALSE` otherwise.