Skip to content

Commit

Permalink
Make only search bar keybinds be prevented (#981)
Browse files Browse the repository at this point in the history
  • Loading branch information
ImUrX committed Apr 9, 2024
1 parent cfd7bc3 commit bcf6614
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions gui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,15 @@ export default function App() {
const isTauri = useIsTauri();

useEffect(() => {
const onKeydown: (arg0: KeyboardEvent) => void = function (e) {
// seems to be sufficient to prevent most default shortcuts
e.preventDefault();
const onKeydown: (arg0: KeyboardEvent) => void = function (event) {
// prevent search bar keybind
if (
event.key === 'F3' ||
(event.ctrlKey && event.key === 'f') ||
(event.metaKey && event.key === 'f')
) {
event.preventDefault();
}
};

window.addEventListener('keydown', onKeydown);
Expand Down

0 comments on commit bcf6614

Please sign in to comment.