From 1e503417f07de0972ce8abc534b7886c78a20bab Mon Sep 17 00:00:00 2001 From: Miodec Date: Mon, 10 Oct 2022 20:13:02 +0200 Subject: [PATCH] allowing shift enter to save progress in book mode --- frontend/src/ts/controllers/input-controller.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/ts/controllers/input-controller.ts b/frontend/src/ts/controllers/input-controller.ts index 749c24ed9..7831334cc 100644 --- a/frontend/src/ts/controllers/input-controller.ts +++ b/frontend/src/ts/controllers/input-controller.ts @@ -28,6 +28,7 @@ import * as CompositionState from "../states/composition"; import * as TestInput from "../test/test-input"; import * as TestWords from "../test/test-words"; import * as Hangul from "hangul-js"; +import * as CustomTextState from "../states/custom-text-name"; import { navigate } from "../observables/navigate-event"; let dontInsertSpace = false; @@ -881,6 +882,13 @@ $(document).keydown(async (event) => { ) { TestInput.setBailout(true); TestLogic.finish(); + } else if ( + event.shiftKey && + Config.mode == "custom" && + CustomTextState.isCustomTextLong() === true + ) { + TestInput.setBailout(true); + TestLogic.finish(); } else { handleChar("\n", TestInput.input.current.length); setWordsInput(" " + TestInput.input.current);