mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-21 01:21:25 -08:00
Make only search bar keybinds be prevented (#981)
This commit is contained in:
1 parent
cfd7bc366e
commit
bcf66145c2
1 file changed
+9
-3
+9
-3
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user