htl-leo-itp-2325-4-5BHITM / cam-connect

Verleihsystem für das Equipment der HTL-Leonding
The Unlicense
2 stars 0 forks source link

Fix keyboard Shortcut system #80

Closed elYanuki closed 5 months ago

elYanuki commented 7 months ago
elYanuki commented 6 months ago

should be fixed but may still be buggy in edgecases.. we should consider just using a libary for this

elYanuki commented 6 months ago

found the bug: when changing focus on the window while having a key pressed the keyup listeners will obviously not trigger resulting in a constantly pressed key. I added a blur listener on the window that clears the pressedkeys everytime focus is lost

elYanuki commented 6 months ago

this is in fact not fixed, the event.target seemingly does not like shadows and just returns the app component

elYanuki commented 6 months ago

yeah no i will not do this myself.. lets just use something like https://craig.is/killing/mice

elYanuki commented 6 months ago

the linked shortcut system is not maintained and not powerful enough, i tried https://github.com/jaywcjlove/hotkeys-js/tree/master but they didnt fix our problems either.. so yea

Is now repeatidly querying the next nested focused element inside a shadowroot to actually find the true target and determine whether or not an input is focused. This will probably need to be expanded to other input types like textareas or contentEditable.

as mentioned in the main description: detection of dead keys is close to impossible since they are a) all referenced as "Dead" and b the "add symbol to next input" functionality is handled by the OS and not preventable by the browser

elYanuki commented 5 months ago

have not encountered any problems so far