spike: keytest logs paste_other, on-screen instructions

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
FactorandClaude Sonnet 5.5 committed 2026-11-19 11:33:12 +01:00
1 parent c655e46dbf
commit d63af25fc1
1 file changed
+12 -1
+12 -1
View File
@@ -20,6 +20,11 @@ export default class KeyTest extends View {
this.textarea.on("change", (e, cx) => this.log("G change", cx));
this.textarea.on("submit", (e, cx) => this.log("G submit", cx));
this.textarea.on("focus", (e, cx) => this.log("G focus", cx));
this.textarea.on("paste_other", (e, cx) => {
let payload = "";
try { payload = " " + JSON.stringify(e).slice(0, 300); } catch {}
this.log("G paste_other" + payload, cx);
});
this.textarea.on("blur", (e, cx) => this.log("G blur", cx));
const bind = (keystroke, action, context) => (context === undefined ? { keystroke, action } : { keystroke, action, context });
@@ -60,7 +65,7 @@ export default class KeyTest extends View {
log(text, cx) {
this.n += 1;
this.lines.push(`${this.n}. ${text}`);
if (this.lines.length > 12) this.lines.shift();
if (this.lines.length > 14) this.lines.shift();
cx?.notify();
}
@@ -87,6 +92,12 @@ export default class KeyTest extends View {
.child(
Textarea.new(this.textarea).w_full().px(10).py(8).rounded(8).bg(t.background).text_color(t.foreground).text_size(13),
)
.child(
div()
.text_size(12)
.text_color(t.accent ?? t.foreground)
.child("Klik w pole → ab → ↑ → ↓ → Ctrl+Alt+J → Ctrl+Alt+K → Ctrl+Alt+L → Ctrl+Alt+U → Ctrl+V (obraz w schowku, np. Win+Shift+S) → napisz w czacie: gotowe"),
)
.children(this.lines.map((l) => div().text_size(12).child(l)));
}
}