From 5dffbb7470c703c13fb9f40b54b45584ab90ba62 Mon Sep 17 00:00:00 2001 From: Daniel Cho Date: Fri, 30 Jul 2021 09:50:07 -0400 Subject: [PATCH 1/2] C2LC-431: Add keyboard shortcut for expand and collapse add nodes --- docs/keyboard.md | 2 ++ src/App.js | 4 ++++ src/KeyboardInputSchemes.js | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/docs/keyboard.md b/docs/keyboard.md index 058f88bf..478c48a6 100644 --- a/docs/keyboard.md +++ b/docs/keyboard.md @@ -36,6 +36,7 @@ follows. | < | decreaseProgramSpeed | | > | increaseProgramSpeed | | ? | showHide | +| + | expandAddNode | | Ctrl + Alt + x, a, b, 1 | selectBackward1 | | Ctrl + Alt + x, a, b, 2 | selectBackward2 | | Ctrl + Alt + x, a, b, 3 | selectBackward3 | @@ -85,6 +86,7 @@ with the starting key of a sequence. Those key bindings are as follows: | < | decreaseProgramSpeed | | > | increaseProgramSpeed | | ? | showHide | +| + | expandAddNode | | Alt + x, a, b, 1 | selectBackward1 | | Alt + x, a, b, 2 | selectBackward2 | | Alt + x, a, b, 3 | selectBackward3 | diff --git a/src/App.js b/src/App.js index 8a1da1f6..06d9bdf4 100644 --- a/src/App.js +++ b/src/App.js @@ -819,6 +819,10 @@ export class App extends React.Component { this.handleChangeCharacterPosition('turnRight'); } break; + case("expandAddNode"): + const currentAddNodeState = this.state.settings.addNodeExpandedMode; + this.handleChangeAddNodeExpandedMode(!currentAddNodeState); + break; default: break; } diff --git a/src/KeyboardInputSchemes.js b/src/KeyboardInputSchemes.js index 9e870fef..62b8f786 100644 --- a/src/KeyboardInputSchemes.js +++ b/src/KeyboardInputSchemes.js @@ -281,6 +281,10 @@ const VoiceOverInputScheme: KeyboardInputScheme = Object.assign({ stopProgram: { keyDef: { code: "KeyS", key: "s", altKey: true}, actionName: "stopProgram" + }, + expandAddNode: { + keyDef: { key: "+"}, + actionName: "expandAddNode" } }, ExtendedKeyboardSequences); @@ -343,6 +347,10 @@ const NvdaInputScheme = Object.assign({ keyDef: {code: "KeyS", key: "s", altKey: true, ctrlKey: true}, actionName: "stopProgram" }, + expandAddNode: { + keyDef: { key: "+", shiftKey: true}, + actionName: "expandAddNode" + } }, NvdaExtendedKeyboardSequences); export const KeyboardInputSchemes:KeyboardInputSchemesType = { From d297afffd03df49398d94f971159edd7cde048f3 Mon Sep 17 00:00:00 2001 From: Daniel Cho Date: Fri, 30 Jul 2021 09:56:54 -0400 Subject: [PATCH 2/2] C2LC-431: Add type for expandAddNode keyboard shortcut --- src/KeyboardInputSchemes.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/KeyboardInputSchemes.js b/src/KeyboardInputSchemes.js index 62b8f786..42b3f0b4 100644 --- a/src/KeyboardInputSchemes.js +++ b/src/KeyboardInputSchemes.js @@ -16,6 +16,7 @@ export type ActionName = | "addCommandToBeginning" | "addCommandToEnd" | "deleteCurrentStep" + | "expandAddNode" | "announceScene" | "decreaseProgramSpeed" | "increaseProgramSpeed"