Skip to content

KeyEvent

#include <Event.hpp>

A keyboard key press event.

Key codes match standard ASCII where applicable. Special keys use values from [vextr::utils::Key](/api/utils/key#key).

Example:

if (auto* k = std::get_if<KeyEvent>(&e)) {
if (k->key == 'q' && !k->modifiers.ctrl)
app->quit();
}
ReturnNameDescription
intkeyKey code (ASCII or utils::Key value)
KeyModifiersmodifiersModifier keys held during the press.

int key

Key code (ASCII or utils::Key value)


KeyModifiers modifiers

Modifier keys held during the press.