turbo-editors/turbo-pythonpublic Fork 0
v1.0.1
Commits
Clone
git clone https://git.rickub.com/turbo-editors/turbo-python.git
git clone ssh://git@rickub.com/turbo-editors/turbo-python.git

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

📦 Turbo Python 6fc62ea · on v1.0.1 · k33g · 8h ago
keyboard.md · 187 lines · 6.8 KBmarkdown
Blame HistoryOpen raw

Reference: keyboard

Complete list of the keys Turbo Python answers to, grouped by what has the focus.

Where two spellings exist, both work: the Turbo C one and the modern one.

Global

Handled wherever the focus is, unless a dialog or the completion popup is open.

Key Action
F1 Describe the symbol under the cursor; with no file open, show the keyboard help
F2 Save
F3 Open
F4 New
F6 Next window
F7 Find next
Shift-F7 Find previous
F8 Open a terminal window
F9 Open the project tree
F10 Open the menu bar
F12 Go to definition
Shift-F12 Find references
Ctrl-T Find a symbol anywhere in the project
Ctrl-F Find
Ctrl-G Go to line
Ctrl-W Close the current window
Alt-X Exit
Alt-1Alt-9 Bring window 1…9 forward
Alt-0 List the open windows
Alt-N Open the Snippets menu
Alt-P Open the Python menu
Alt-<letter> Open the menu whose title carries that letter

A 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 Python tools.

Editing

Handled by the window that has the focus.

Movement

Key Action
One character or one line
Ctrl-← Ctrl-→ Start of the previous / next word
Home End Start / end of the line
Ctrl-Home Ctrl-End Start / end of the file
PgUp PgDn One screenful
Shift + any of the above The same movement, extending the selection

Changing the text

Key Action
any printable character Insert it, replacing the selection
Enter Split the line, copying the current line's indentation
Backspace Delete the selection, or the character before the cursor
Delete Delete the selection, or the character under the cursor
Tab Insert a tab; with a selection, indent every line it touches
Shift-Tab Remove one level of indentation from every line the selection touches

Clipboard and history

Key Also Action
Ctrl-C Ctrl-Ins Copy the selection
Ctrl-X Shift-Del Cut the selection
Ctrl-V Shift-Ins Paste
Ctrl-A Select the whole file
Ctrl-Z Undo
Ctrl-R Redo
Ctrl-N Insert a blank line above the cursor
Ctrl-Y Delete the line the cursor is on

A run of typed characters, or a run of backspaces, is a single undo step. Moving the cursor ends the run.

Language server

Key Action
Ctrl-Space Ask for a completion list
. Ask for a completion list, as a side effect of typing it
F1 Describe the symbol under the cursor
F12 Go to the declaration

Once a menu is open.

Key Action
Previous / next menu
Previous / next item, skipping separators and disabled items
Enter Run the highlighted item
<letter> Run the item whose label carries that letter
Escape Close the menu

An item marked opens a submenu instead of running:

Key Action
, Enter Open the highlighted submenu; on an item without one moves to the next menu
Step back out to the parent menu
Escape Close the whole menu, wherever you are
Walk the submenu
<letter> Run the submenu item whose label carries that letter

Any other key is swallowed, so stray typing never reaches the file behind.

Dialogs

Key Action
Tab / Shift-Tab Next / previous control
Walk the focused list; when the focused control has no use for them, the next / previous control
Enter Press the default button, from wherever the focus is
Escape Cancel
Alt-<letter> Press the button whose label carries that letter
Ctrl-U Clear the focused input field

A dialog is modal: every key it does not use is swallowed rather than passed to the editor behind it.

The Open and Save As box

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.
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.
Enter on the list Opens the highlighted file, or browses into the highlighted directory
OK Acts on the Name field; when the field is empty, acts on whatever the list has highlighted
A name that is a directory Browses into it rather than closing the dialog
Double click The same as Enter on that entry

Dot-files are not listed. Directories come before files, each group sorted, with ../ first.

Completion popup

Key Action
Previous / next suggestion
PgUp PgDn Eight at a time
Enter, Tab Accept the highlighted suggestion
Escape Dismiss the list
any printable character Passed through to the editor; the list narrows to what still matches

Terminal windows

A terminal window in front gets every key except the function keys, Alt-X and Alt-0Alt-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.

Key Action
Shift-PgUp Shift-PgDn Read back / forward one screenful through the history
anything else not reserved above Sent to the shell, returning the view to the live screen

The exact byte each key sends is in Terminal windows.

Project tree

Handled when the tree window has the focus. The full rules are in Project tree.

Key Action
PgUp PgDn Home End Move the highlight
Expand a closed directory, else step to the next row
Collapse an open directory, else step out to its directory
Enter Open a file; expand or collapse a directory
F5, Ctrl-R Re-read the project

Mouse

Action Effect
Click in the text Place the cursor
Drag in the text Select
Wheel Scroll three lines
Click a menu title Open or close that menu
Click a status-bar hint Run it
Click a window Bring it forward
Drag a title bar Move the window
Drag the bottom-right corner Resize the window
Click [x] Close the window
Click [■] Fill the desktop with the window
Click [▬] Put a filled window back where it was
Wheel over a terminal Scroll three lines through its history
Click a tree row Highlight it; a second click opens it
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# Reference: keyboard

> Complete list of the keys Turbo Python answers to, grouped by what has the focus.

Where two spellings exist, both work: the Turbo C one and the modern one.

## Global

Handled wherever the focus is, unless a dialog or the completion popup is open.

| Key | Action |
| --- | --- |
| `F1` | Describe the symbol under the cursor; with no file open, show the keyboard help |
| `F2` | Save |
| `F3` | Open |
| `F4` | New |
| `F6` | Next window |
| `F7` | Find next |
| `Shift-F7` | Find previous |
| `F8` | Open a terminal window |
| `F9` | Open the project tree |
| `F10` | Open the menu bar |
| `F12` | Go to definition |
| `Shift-F12` | Find references |
| `Ctrl-T` | Find a symbol anywhere in the project |
| `Ctrl-F` | Find |
| `Ctrl-G` | Go to line |
| `Ctrl-W` | Close the current window |
| `Alt-X` | Exit |
| `Alt-1``Alt-9` | Bring window 1…9 forward |
| `Alt-0` | List the open windows |
| `Alt-N` | Open the Snippets menu |
| `Alt-P` | Open the Python menu |
| `Alt-<letter>` | Open the menu whose title carries that letter |

A 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 [Python tools](python-tools.md#hot-keys).

## Editing

Handled by the window that has the focus.

### Movement

| Key | Action |
| --- | --- |
| `←` `→` `↑` `↓` | One character or one line |
| `Ctrl-←` `Ctrl-→` | Start of the previous / next word |
| `Home` `End` | Start / end of the line |
| `Ctrl-Home` `Ctrl-End` | Start / end of the file |
| `PgUp` `PgDn` | One screenful |
| `Shift` + any of the above | The same movement, extending the selection |

### Changing the text

| Key | Action |
| --- | --- |
| any printable character | Insert it, replacing the selection |
| `Enter` | Split the line, copying the current line's indentation |
| `Backspace` | Delete the selection, or the character before the cursor |
| `Delete` | Delete the selection, or the character under the cursor |
| `Tab` | Insert a tab; with a selection, indent every line it touches |
| `Shift-Tab` | Remove one level of indentation from every line the selection touches |

### Clipboard and history

| Key | Also | Action |
| --- | --- | --- |
| `Ctrl-C` | `Ctrl-Ins` | Copy the selection |
| `Ctrl-X` | `Shift-Del` | Cut the selection |
| `Ctrl-V` | `Shift-Ins` | Paste |
| `Ctrl-A` | | Select the whole file |
| `Ctrl-Z` | | Undo |
| `Ctrl-R` | | Redo |
| `Ctrl-N` | | Insert a blank line above the cursor |
| `Ctrl-Y` | | Delete the line the cursor is on |

A run of typed characters, or a run of backspaces, is a **single** undo step. Moving the cursor ends the run.

### Language server

| Key | Action |
| --- | --- |
| `Ctrl-Space` | Ask for a completion list |
| `.` | Ask for a completion list, as a side effect of typing it |
| `F1` | Describe the symbol under the cursor |
| `F12` | Go to the declaration |

## Menu bar

Once a menu is open.

| Key | Action |
| --- | --- |
| `←` `→` | Previous / next menu |
| `↑` `↓` | Previous / next item, skipping separators and disabled items |
| `Enter` | Run the highlighted item |
| `<letter>` | Run the item whose label carries that letter |
| `Escape` | Close the menu |

An item marked `▶` opens a submenu instead of running:

| Key | Action |
| --- | --- |
| `→`, `Enter` | Open the highlighted submenu; `→` on an item without one moves to the next menu |
| `←` | Step back out to the parent menu |
| `Escape` | Close the whole menu, wherever you are |
| `↑` `↓` | Walk the submenu |
| `<letter>` | Run the submenu item whose label carries that letter |

Any other key is swallowed, so stray typing never reaches the file behind.

## Dialogs

| Key | Action |
| --- | --- |
| `Tab` / `Shift-Tab` | Next / previous control |
| `↑` `↓` | Walk the focused list; when the focused control has no use for them, the next / previous control |
| `Enter` | Press the default button, from wherever the focus is |
| `Escape` | Cancel |
| `Alt-<letter>` | Press the button whose label carries that letter |
| `Ctrl-U` | Clear the focused input field |

A dialog is modal: every key it does not use is swallowed rather than passed to the editor behind it.

### The Open and Save As box

| | |
| --- | --- |
| 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. |
| 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. |
| `Enter` on the list | Opens the highlighted file, or browses into the highlighted directory |
| **OK** | Acts on the **Name** field; when the field is empty, acts on whatever the list has highlighted |
| A name that is a directory | Browses into it rather than closing the dialog |
| Double click | The same as `Enter` on that entry |

Dot-files are not listed. Directories come before files, each group sorted, with `../` first.

## Completion popup

| Key | Action |
| --- | --- |
| `↑` `↓` | Previous / next suggestion |
| `PgUp` `PgDn` | Eight at a time |
| `Enter`, `Tab` | Accept the highlighted suggestion |
| `Escape` | Dismiss the list |
| any printable character | Passed through to the editor; the list narrows to what still matches |

## Terminal windows

A 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.

| Key | Action |
| --- | --- |
| `Shift-PgUp` `Shift-PgDn` | Read back / forward one screenful through the history |
| anything else not reserved above | Sent to the shell, returning the view to the live screen |

The exact byte each key sends is in [Terminal windows](terminal.md).

## Project tree

Handled when the tree window has the focus. The full rules are in [Project tree](project-tree.md).

| Key | Action |
| --- | --- |
| `↑` `↓` `PgUp` `PgDn` `Home` `End` | Move the highlight |
| `→` | Expand a closed directory, else step to the next row |
| `←` | Collapse an open directory, else step out to its directory |
| `Enter` | Open a file; expand or collapse a directory |
| `F5`, `Ctrl-R` | Re-read the project |

## Mouse

| Action | Effect |
| --- | --- |
| Click in the text | Place the cursor |
| Drag in the text | Select |
| Wheel | Scroll three lines |
| Click a menu title | Open or close that menu |
| Click a status-bar hint | Run it |
| Click a window | Bring it forward |
| Drag a title bar | Move the window |
| Drag the bottom-right corner | Resize the window |
| Click `[x]` | Close the window |
| Click `[■]` | Fill the desktop with the window |
| Click `[▬]` | Put a filled window back where it was |
| Wheel over a terminal | Scroll three lines through its history |
| Click a tree row | Highlight it; a second click opens it |