Skip to content

Commit

Permalink
Implement space toggles speak (#2622)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuomas2 committed Oct 12, 2023
1 parent 5ce5856 commit a7567f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/bibleview-js/src/composables/keyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {computed, ComputedRef, ref, watch} from "vue";

const altKeys: Set<string> = new Set(["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "KeyW", "KeyM", "KeyO", "KeyG"]);
const ctrlKeys: Set<string> = new Set(["KeyC"]);
const keys: Set<string> = new Set(["ArrowUp", "ArrowDown"]);
const keys: Set<string> = new Set(["ArrowUp", "ArrowDown", "Space"]);
const handleJsSide: Set<string> = new Set(["ArrowUp", "ArrowDown"]);

export function useKeyboard(
Expand Down Expand Up @@ -54,6 +54,7 @@ export function useKeyboard(
doScrolling(window.scrollY - lineHeight.value, 50);
}
} else {
if(key === "Space" && isEditing.value) return;
onKeyDown(key);
}
e.preventDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,11 @@ class BibleJavascriptInterface(
"AltKeyO" -> mainBibleActivity.showOptionsMenu()
"AltKeyG" -> bibleView.window.pageManager.currentPage.startKeyChooser(mainBibleActivity)
"CtrlKeyC" -> bibleView.copySelectionToClipboard()
"Space" -> {
if(!mainBibleActivity.speakControl.isStopped) {
mainBibleActivity.speakControl.toggleSpeak(true)
}
}
}
}
}
Expand Down

0 comments on commit a7567f5

Please sign in to comment.