aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/GlobalKeyHandler.ts
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-08-03 17:17:43 -0400
committerSam Wilkins <samwilkins333@gmail.com>2019-08-03 17:17:43 -0400
commit813476d753f0286d546a0b1c9f1b1774481604e0 (patch)
tree4ca664106659649748f94e3c2412fd548342bbe9 /src/client/views/GlobalKeyHandler.ts
parent30444bd06dbd00c948749fa739e7a42cef87ec85 (diff)
final refactor and commenting
Diffstat (limited to 'src/client/views/GlobalKeyHandler.ts')
-rw-r--r--src/client/views/GlobalKeyHandler.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/client/views/GlobalKeyHandler.ts b/src/client/views/GlobalKeyHandler.ts
index b1ea92bb8..82289c249 100644
--- a/src/client/views/GlobalKeyHandler.ts
+++ b/src/client/views/GlobalKeyHandler.ts
@@ -74,7 +74,7 @@ export default class KeyManager {
DictationManager.Controls.stop();
main.dictationOverlayVisible = false;
main.dictationSuccess = undefined;
- main.overlayTimeout && clearTimeout(main.overlayTimeout);
+ main.cancelDictationFade();
break;
case "delete":
case "backspace":
@@ -110,19 +110,19 @@ export default class KeyManager {
case " ":
let main = MainView.Instance;
main.dictationOverlayVisible = true;
+
main.isListening = true;
let command = await DictationManager.Controls.listen((results: any) => console.log(results));
main.isListening = false;
+
if (!command) {
break;
}
- command = command.toLowerCase();
- main.dictatedPhrase = command;
+
+ main.dictatedPhrase = command = command.toLowerCase();
main.dictationSuccess = await DictationManager.Commands.execute(command);
- main.overlayTimeout = setTimeout(() => {
- main.dictationOverlayVisible = false;
- main.dictationSuccess = undefined;
- }, 2000);
+ main.initiateDictationFade();
+
stopPropagation = true;
preventDefault = true;
}