type: every printable ASCII character, including shifted punctuation the backtick key: CAPS LOCK toggle — for capital letters ~: BACKSPACE (shift + backtick, the same physical key) arrows: move the caret; these repeat while held enter: new line, with auto-indent click: put the caret anywhere; drag to keep moving it left rail: explorer, find, command palette, markdown preview explorer: click a file to open it; NEW REN DEL under the list status bar: CMD palette, RUN for .py files, language name cycles scrollbar: click or drag One keystroke per keystroke. Characters fire on the key's release, not its press, so however long you hold a letter you get exactly one of it. Arrows are the exception and repeat while held, because they navigate — see below, it took three attempts to get this right. Command palette — 24 commands, filtered as you type: indent, outdent, toggle comment, duplicate/delete/join line, move line up/down, trim trailing space, go to top/end, toggle explorer, find and replace, replace all, new/rename/delete file, toggle markdown preview, run script, close output, and the five language pickers. Arrows select, enter runs, any click outside dismisses.
A code editor in Scratch. The document is a list of lines with a caret you can click, a real tokeniser colours it as you type — keywords, strings, numbers, comments, calls, with block comments carried across lines — and there are four files, three languages, line numbers, current-line highlight, bracket matching, auto-indent, find and replace, a collapsible explorer, tabs, a status bar and a command palette. Open KEYS.txt from the explorer. It is the keyboard documentation, inside the editor, as a file the editor is editing. AUTO-REPEAT, AND WHY IT TOOK THREE ATTEMPTS Worth writing down, because two plausible fixes were both wrong. The first version fired on the press edge and repeated after 0.4 s at 15/sec. Holding a letter for one second produced about ten of it. Slowing the repeat to 7.5/sec still produced four. There is no correct rate for a letter, because the request was never "repeat more slowly" — it was "one keystroke per keystroke". Underneath that was a second bug that no rate could have fixed. The repeat was counted in ticks, and scratch-vm's sequencer keeps stepping threads inside one frame until its work budget runs out or a block requests a redraw. An idle editor paints nothing and therefore asks for no redraw, so tick runs several times per frame — measured here at 44 ticks in 30 frames, and the ratio grows with the speed of the machine. Anything counted in ticks therefore runs faster on better hardware. The caret blink had the same disease. So: the blink and the arrow repeat are driven by timer(), which is wall clock and is constant within a non-yielding func, so sampling it once per tick gives a stable clock. And characters do not repeat at all — they fire when the key reads not pressed having previously read pressed, which is one event per physical press by construction. Backspace is release-edge too, for the same reason a stray letter is worse than a stray caret move: it destroys work. found is the first pressed key in list order rather than the most recent, which is what makes roll-over work. When a second key goes down before the first one's release has been seen — normal at any typing speed — whichever key is no longer hkey is flushed rather than dropped, and the characters come out in order. The one cost, inherent to polling: a press that begins and ends between two samples is invisible. At 30 fps that is a 33 ms press, which no human produces. WHY THE KEYBOARD IS LIKE THAT scratch-vm converts a browser key name into a "Scratch key" and **discards anything longer than one character**. That is the whole story: Backspace, Shift, Tab, Control, Escape are nine, five, three, seven and six characters long, so a Scratch project cannot see any of them, ever. Not "not easily" — the key never arrives. What it can see is every single-character key, and that turns out to include shifted punctuation, because the browser reports Shift+[ as { rather than as [ plus a modifier. So { } ( ) [ ] < > " ' ! @ # $ % ^ & * _ + | : ; ? are all distinct, detectable keys, and writing code is actually possible. Only the letters lose their case: a and Shift+a both arrive as A. So capitals are a mode ( , the convention GojoOS established) and Backspace is ~, which is Shift+backtick — the same physical key, so there is one thing to remember rather than two. All original - code, art and sound. See Inside is open.