Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C2LC-433: Add keyboard shortcut for pen down toggle #231

Open
wants to merge 3 commits into
base: develop-1.0
Choose a base branch
from
Open
Changes from 1 commit
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
Next Next commit
C2LC-433: Add keyboard shortcut for pen down toggle
chosww committed Jul 30, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 96327c14c0e8cff57c2e20beb7573df3b285bdb2
2 changes: 2 additions & 0 deletions docs/keyboard.md
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@ follows.
| Ctrl + Alt + p | playPauseProgram |
| Ctrl + Alt + r | refreshScene |
| Ctrl + Alt + s | stopProgram |
| Ctrl + Alt + n | penDownToggle |
| < | decreaseProgramSpeed |
| > | increaseProgramSpeed |
| ? | showHide |
@@ -82,6 +83,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 |
4 changes: 4 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -819,6 +819,10 @@ export class App extends React.Component<AppProps, AppState> {
this.handleChangeCharacterPosition('turnRight');
}
break;
case("penDownToggle"):
const currentPendownState = this.state.drawingEnabled;
this.handleTogglePenDown(!currentPendownState);
break;
default:
break;
}
9 changes: 9 additions & 0 deletions src/KeyboardInputSchemes.js
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ export type ActionName =
| "announceScene"
| "decreaseProgramSpeed"
| "increaseProgramSpeed"
| "penDownToggle"
| "playPauseProgram"
| "refreshScene"
| "showHide"
@@ -281,6 +282,10 @@ const VoiceOverInputScheme: KeyboardInputScheme = Object.assign({
stopProgram: {
keyDef: { code: "KeyS", key: "s", altKey: true},
actionName: "stopProgram"
},
penDownToggle: {
keyDef: { code: "KeyN", key: "n", altKey: true},
actionName: "penDownToggle"
}
}, ExtendedKeyboardSequences);

@@ -343,6 +348,10 @@ const NvdaInputScheme = 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"
}
}, NvdaExtendedKeyboardSequences);

export const KeyboardInputSchemes:KeyboardInputSchemesType = {