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:
@@ -1,3 +1,4 @@
|
||||
#include "app_keys.h"
|
||||
#include "note_editor.h"
|
||||
|
||||
#include <Arduino.h>
|
||||
@@ -183,15 +184,8 @@ bool NoteEditor::save() {
|
||||
}
|
||||
|
||||
void NoteEditor::help(std::vector<KeyHelp>& out) const {
|
||||
if (dialog_) return help::dialog(out);
|
||||
out.push_back({"Enter", "a new line"});
|
||||
out.push_back({"Del", "delete backwards"});
|
||||
out.push_back({"Tab", "two spaces"});
|
||||
out.push_back({"Fn ; . , /", "move the cursor"});
|
||||
out.push_back({"Alt Fn ; .", "a page up, down"});
|
||||
out.push_back({"Ctrl a e", "start, end of the line"});
|
||||
out.push_back({"opt ' e", "an accent: \xC3\xA9"});
|
||||
out.push_back({"`", "done: it saves by itself"});
|
||||
if (dialog_) return keys::add(out, keys::kDialog);
|
||||
keys::add(out, keys::kNotesEditor);
|
||||
}
|
||||
|
||||
bool NoteEditor::onKey(const KeyEvent& e) {
|
||||
|
||||
Reference in New Issue
Block a user