Public Access
Keys: one table file for the device's help panel and the website's key tables (#72)
Every screen's keys are constant tables in lib/core/src/app_keys.h (52 of them, each under an `// id: Title` comment). An App's help() picks the table of the state it is in. site/tools/gen_dev_docs.py reads the same file and writes site/data/keys.toml; the `keys` shortcode shows a screen's tables on its guide page, and /guide/keys/ shows all of them. The Site job fails when the data file is out of date or a page asks for a table that doesn't exist, and now also runs when app_keys.h changes. A key added to an App shows up on the website without anyone editing a page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
@@ -16,35 +16,6 @@ struct KeyHelp {
|
||||
const char* action;
|
||||
};
|
||||
|
||||
namespace help {
|
||||
|
||||
// Lists that several screens share.
|
||||
inline void list(std::vector<KeyHelp>& out, const char* enter = "open") {
|
||||
out.push_back({"; .", "up, down"});
|
||||
out.push_back({"Enter", enter});
|
||||
}
|
||||
inline void dialog(std::vector<KeyHelp>& out) {
|
||||
out.push_back({", /", "the other answer"});
|
||||
out.push_back({"Enter", "choose it"});
|
||||
out.push_back({"`", "cancel"});
|
||||
}
|
||||
inline void textEntry(std::vector<KeyHelp>& out, const char* enter = "save") {
|
||||
out.push_back({"Enter", enter});
|
||||
out.push_back({"`", "cancel"});
|
||||
out.push_back({"Del", "delete backwards"});
|
||||
out.push_back({"Fn , /", "move the cursor"});
|
||||
out.push_back({"opt ' e", "an accent: \xC3\xA9"});
|
||||
}
|
||||
// What works on every screen: the end of every panel.
|
||||
inline void everywhere(std::vector<KeyHelp>& out) {
|
||||
out.push_back({"Everywhere", nullptr});
|
||||
out.push_back({"`", "back"});
|
||||
out.push_back({"Fn `", "home, the Launcher"});
|
||||
out.push_back({"; . , /", "arrows (Fn+ while typing)"});
|
||||
out.push_back({"Fn h ?", "these keys (? not typing)"});
|
||||
}
|
||||
|
||||
} // namespace help
|
||||
|
||||
// The panel itself: what it lists, and how far it's scrolled. The keys it takes while open are the
|
||||
// arrows; any other key closes it, and none reaches the App.
|
||||
|
||||
Reference in New Issue
Block a user