Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/keyboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ follows.
| Ctrl + Alt + p | playPauseProgram |
| Ctrl + Alt + r | refreshScene |
| Ctrl + Alt + s | stopProgram |
| Ctrl + Alt + n | penDownToggle |
| < | decreaseProgramSpeed |
| > | increaseProgramSpeed |
| ? | showHide |
Expand Down Expand Up @@ -89,6 +90,7 @@ with the starting key of a sequence. Those key bindings are as follows:
| Alt + p | playPauseProgram |
| Alt + r | refreshScene |
| Alt + s | stopProgram |
| Alt + n | penDownToggle |
| < | decreaseProgramSpeed |
| > | increaseProgramSpeed |
| ? | showHide |
Expand Down
4 changes: 4 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,10 @@ export class App extends React.Component<AppProps, AppState> {
this.handleChangeCharacterPosition('turnRight');
}
break;
case("penDownToggle"):
const currentPendownState = this.state.drawingEnabled;
this.handleTogglePenDown(!currentPendownState);
break;
case("changeToDefaultTheme"):
this.setStateSettings({theme: "mixed"});
break;
Expand Down
9 changes: 9 additions & 0 deletions src/KeyboardInputSchemes.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type ActionName =
| "announceScene"
| "decreaseProgramSpeed"
| "increaseProgramSpeed"
| "penDownToggle"
| "playPauseProgram"
| "refreshScene"
| "showHide"
Expand Down Expand Up @@ -321,6 +322,10 @@ const AltInputScheme: KeyboardInputScheme = Object.assign({
stopProgram: {
keyDef: { code: "KeyS", key: "s", altKey: true},
actionName: "stopProgram"
},
penDownToggle: {
keyDef: { code: "KeyN", key: "n", altKey: true},
actionName: "penDownToggle"
}
}, ExtendedKeyboardSequences);

Expand Down Expand Up @@ -387,6 +392,10 @@ const ControlAltInputScheme = Object.assign({
keyDef: {code: "KeyS", key: "s", altKey: true, ctrlKey: true},
actionName: "stopProgram"
},
penDownToggle: {
keyDef: { code: "KeyN", key: "n", altKey: true, ctrlKey: true},
actionName: "penDownToggle"
}
}, ControlAltExtendedKeyboardSequences);

export const KeyboardInputSchemes:KeyboardInputSchemesType = {
Expand Down