diff --git a/docs/keyboard.md b/docs/keyboard.md index f1f13cfb..dc438936 100644 --- a/docs/keyboard.md +++ b/docs/keyboard.md @@ -37,6 +37,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 | @@ -92,6 +93,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 69e1b3bd..dd8d761a 100644 --- a/src/App.js +++ b/src/App.js @@ -865,6 +865,10 @@ export class App extends React.Component { this.handleChangeCharacterPosition('turnRight'); } break; + case("expandAddNode"): + const currentAddNodeState = this.state.settings.addNodeExpandedMode; + this.handleChangeAddNodeExpandedMode(!currentAddNodeState); + break; case("changeToDefaultTheme"): this.setStateSettings({theme: "mixed"}); break; diff --git a/src/KeyboardInputSchemes.js b/src/KeyboardInputSchemes.js index 6baa10be..8dd25f80 100644 --- a/src/KeyboardInputSchemes.js +++ b/src/KeyboardInputSchemes.js @@ -21,6 +21,7 @@ export type ActionName = | "addCommandToBeginning" | "addCommandToEnd" | "deleteCurrentStep" + | "expandAddNode" | "announceScene" | "decreaseProgramSpeed" | "increaseProgramSpeed" @@ -321,6 +322,10 @@ const AltInputScheme: KeyboardInputScheme = Object.assign({ stopProgram: { keyDef: { code: "KeyS", key: "s", altKey: true}, actionName: "stopProgram" + }, + expandAddNode: { + keyDef: { key: "+"}, + actionName: "expandAddNode" } }, ExtendedKeyboardSequences); @@ -387,6 +392,10 @@ const ControlAltInputScheme = Object.assign({ keyDef: {code: "KeyS", key: "s", altKey: true, ctrlKey: true}, actionName: "stopProgram" }, + expandAddNode: { + keyDef: { key: "+", shiftKey: true}, + actionName: "expandAddNode" + } }, ControlAltExtendedKeyboardSequences); export const KeyboardInputSchemes:KeyboardInputSchemesType = {