Files
roro9stack/lib/core/src/key_event.h
T
twislaandClaude Opus 5.5 4cdb4c342f
CI / build (pull_request) Successful in 1m44s
Site / build (pull_request) Successful in 9s
Screenshots: Fn+p on every screen (#83)
Fn+p saves the screen as it is to /screenshots, as the Shell's `screenshot`
does, from anywhere: text fields, dialogs and the help panel included. The
key never reaches an App.

It refuses on Settings > Debug Console, which shows the token: a picture of
that page is a copy of the token in a file (App::showsSecret). `key shot`
presses it over the consoles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
2026-10-07 21:39:16 +02:00

44 lines
934 B
C++

#pragma once
#include <cstdint>
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,
Help, // Fn+h anywhere, or ? outside Text Entry: the keys of this screen (issue #69)
Screenshot, // Fn+p anywhere: the screen as a PNG on the card (issue #83). Never reaches an App
};
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