#pragma once #include namespace roro { // Logical keys, already translated from the physical keyboard (Fn combos, Esc position, etc.). enum class Key : uint8_t { Char, // a printable character in `ch` (Unicode code point, accents already composed) Up, Down, Left, Right, Select, Back, Home, Tab, Delete, }; struct KeyEvent { Key key = Key::Char; uint32_t ch = 0; bool shift = false; bool ctrl = false; bool alt = false; static KeyEvent of(Key key) { KeyEvent e; e.key = key; return e; } static KeyEvent character(uint32_t codePoint) { KeyEvent e; e.ch = codePoint; return e; } }; } // namespace roro