turbo-editors/turbo-jspublic Fork 0
3541d0a7502339a318371eba31ebefcf4ebb0ab5
Commits
Clone
git clone https://git.rickub.com/turbo-editors/turbo-js.git
git clone ssh://git@rickub.com/turbo-editors/turbo-js.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

keyboard.md · 188 lines · 6.9 KBmarkdown Blame HistoryRaw
📦 Turbo JS 91999d1 k33g 19h ago1# Reference: keyboard
2
3> Complete list of the keys Turbo JS answers to, grouped by what has the focus.
4
5Where two spellings exist, both work: the Turbo C one and the modern one.
6
7## Global
8
9Handled wherever the focus is, unless a dialog or the completion popup is open.
10
11| Key | Action |
12| --- | --- |
13| `F1` | Describe the symbol under the cursor; with no file open, show the keyboard help |
14| `F2` | Save |
15| `F3` | Open |
16| `F4` | New |
17| `F6` | Next window |
18| `F7` | Find next |
19| `Shift-F7` | Find previous |
20| `F8` | Open a terminal window |
21| `F9` | Open the project tree |
22| `F10` | Open the menu bar |
23| `F12` | Go to definition |
24| `Shift-F12` | Find references |
25| `Ctrl-T` | Find a symbol anywhere in the project |
26| `Ctrl-F` | Find |
27| `Ctrl-G` | Go to line |
28| `Ctrl-W` | Close the current window |
29| `Alt-X` | Exit |
30| `Alt-1``Alt-9` | Bring window 1…9 forward |
31| `Alt-0` | List the open windows |
32| `Alt-N` | Open the Snippets menu |
33| `Alt-A` | Open the Agent menu |
34| `Alt-J` | Open the JavaScript menu |
35| `Alt-<letter>` | Open the menu whose title carries that letter |
36
37A menu the project's tools file adds gets its letter assigned rather than fixed, so it is never one of the above. The rules are in [JavaScript tools](javascript-tools.md#hot-keys).
38
39## Editing
40
41Handled by the window that has the focus.
42
43### Movement
44
45| Key | Action |
46| --- | --- |
47| `←` `→` `↑` `↓` | One character or one line |
48| `Ctrl-←` `Ctrl-→` | Start of the previous / next word |
49| `Home` `End` | Start / end of the line |
50| `Ctrl-Home` `Ctrl-End` | Start / end of the file |
51| `PgUp` `PgDn` | One screenful |
52| `Shift` + any of the above | The same movement, extending the selection |
53
54### Changing the text
55
56| Key | Action |
57| --- | --- |
58| any printable character | Insert it, replacing the selection |
59| `Enter` | Split the line, copying the current line's indentation |
60| `Backspace` | Delete the selection, or the character before the cursor |
61| `Delete` | Delete the selection, or the character under the cursor |
62| `Tab` | Insert a tab; with a selection, indent every line it touches |
63| `Shift-Tab` | Remove one level of indentation from every line the selection touches |
64
65### Clipboard and history
66
67| Key | Also | Action |
68| --- | --- | --- |
69| `Ctrl-C` | `Ctrl-Ins` | Copy the selection |
70| `Ctrl-X` | `Shift-Del` | Cut the selection |
71| `Ctrl-V` | `Shift-Ins` | Paste |
72| `Ctrl-A` | | Select the whole file |
73| `Ctrl-Z` | | Undo |
74| `Ctrl-R` | | Redo |
75| `Ctrl-N` | | Insert a blank line above the cursor |
76| `Ctrl-Y` | | Delete the line the cursor is on |
77
78A run of typed characters, or a run of backspaces, is a **single** undo step. Moving the cursor ends the run.
79
80### Language server
81
82| Key | Action |
83| --- | --- |
84| `Ctrl-Space` | Ask for a completion list |
85| `.` | Ask for a completion list, as a side effect of typing it |
86| `F1` | Describe the symbol under the cursor |
87| `F12` | Go to the declaration |
88
89## Menu bar
90
91Once a menu is open.
92
93| Key | Action |
94| --- | --- |
95| `←` `→` | Previous / next menu |
96| `↑` `↓` | Previous / next item, skipping separators and disabled items |
97| `Enter` | Run the highlighted item |
98| `<letter>` | Run the item whose label carries that letter |
99| `Escape` | Close the menu |
100
101An item marked `▶` opens a submenu instead of running:
102
103| Key | Action |
104| --- | --- |
105| `→`, `Enter` | Open the highlighted submenu; `→` on an item without one moves to the next menu |
106| `←` | Step back out to the parent menu |
107| `Escape` | Close the whole menu, wherever you are |
108| `↑` `↓` | Walk the submenu |
109| `<letter>` | Run the submenu item whose label carries that letter |
110
111Any other key is swallowed, so stray typing never reaches the file behind.
112
113## Dialogs
114
115| Key | Action |
116| --- | --- |
117| `Tab` / `Shift-Tab` | Next / previous control |
118| `↑` `↓` | Walk the focused list; when the focused control has no use for them, the next / previous control |
119| `Enter` | Press the default button, from wherever the focus is |
120| `Escape` | Cancel |
121| `Alt-<letter>` | Press the button whose label carries that letter |
122| `Ctrl-U` | Clear the focused input field |
123
124A dialog is modal: every key it does not use is swallowed rather than passed to the editor behind it.
125
126### The Open and Save As box
127
128| | |
129| --- | --- |
130| Focus on opening | The **Name** field, so a name can be typed straight away. The first `↓` therefore moves the focus to the list; the second moves the highlight. |
131| Moving the highlight | Puts that entry's name into the **Name** field, so the field always says what **OK** will act on. Highlighting `../` clears it. |
132| `Enter` on the list | Opens the highlighted file, or browses into the highlighted directory |
133| **OK** | Acts on the **Name** field; when the field is empty, acts on whatever the list has highlighted |
134| A name that is a directory | Browses into it rather than closing the dialog |
135| Double click | The same as `Enter` on that entry |
136
137Dot-files are not listed. Directories come before files, each group sorted, with `../` first.
138
139## Completion popup
140
141| Key | Action |
142| --- | --- |
143| `↑` `↓` | Previous / next suggestion |
144| `PgUp` `PgDn` | Eight at a time |
145| `Enter`, `Tab` | Accept the highlighted suggestion |
146| `Escape` | Dismiss the list |
147| any printable character | Passed through to the editor; the list narrows to what still matches |
148
149## Terminal windows
150
151A terminal window in front gets **every key except** the function keys, `Alt-X` and `Alt-0``Alt-9`, which stay with the editor so there is always a way out of a full-screen program. `Ctrl-C`, `Ctrl-W`, `Ctrl-F` and `Alt-<letter>` therefore reach the shell rather than the editor.
152
153| Key | Action |
154| --- | --- |
155| `Shift-PgUp` `Shift-PgDn` | Read back / forward one screenful through the history |
156| anything else not reserved above | Sent to the shell, returning the view to the live screen |
157
158The exact byte each key sends is in [Terminal windows](terminal.md).
159
160## Project tree
161
162Handled when the tree window has the focus. The full rules are in [Project tree](project-tree.md).
163
164| Key | Action |
165| --- | --- |
166| `↑` `↓` `PgUp` `PgDn` `Home` `End` | Move the highlight |
167| `→` | Expand a closed directory, else step to the next row |
168| `←` | Collapse an open directory, else step out to its directory |
169| `Enter` | Open a file; expand or collapse a directory |
170| `F5`, `Ctrl-R` | Re-read the project |
171
172## Mouse
173
174| Action | Effect |
175| --- | --- |
176| Click in the text | Place the cursor |
177| Drag in the text | Select |
178| Wheel | Scroll three lines |
179| Click a menu title | Open or close that menu |
180| Click a status-bar hint | Run it |
181| Click a window | Bring it forward |
182| Drag a title bar | Move the window |
183| Drag the bottom-right corner | Resize the window |
184| Click `[x]` | Close the window |
185| Click `[■]` | Fill the desktop with the window |
186| Click `[▬]` | Put a filled window back where it was |
187| Wheel over a terminal | Scroll three lines through its history |
188| Click a tree row | Highlight it; a second click opens it |