mirror of https://github.com/jetkvm/kvm.git
Compare commits
2 Commits
eced5b63fe
...
7c91d373e3
Author | SHA1 | Date |
---|---|---|
|
7c91d373e3 | |
|
909ae884e5 |
|
@ -332,19 +332,25 @@ export default function WebRTCVideo() {
|
||||||
// Example: If altKey is true, keep all modifiers
|
// Example: If altKey is true, keep all modifiers
|
||||||
// If altKey is false, filter out 0x04 (AltLeft)
|
// If altKey is false, filter out 0x04 (AltLeft)
|
||||||
//
|
//
|
||||||
// But intentionally do not filter out 0x40 (AltRight) to enable Alt Gr
|
// But intentionally do not filter out 0x40 (AltRight) to accomodate
|
||||||
// (Alt Graph) as a modifier. The altKey attribute is set to false on
|
// Alt Gr (Alt Graph) as a modifier. Oddly, Alt Gr does not declare
|
||||||
// key combinations involving the Alt Gr key, which means the modifier
|
// itself to be an altKey. For example, the KeyboardEvent for
|
||||||
// would otherwise be unintentionally removed from the filteredModifiers
|
// Alt Gr + 2 has the following structure:
|
||||||
// list.
|
|
||||||
//
|
|
||||||
// For example, the KeyboardEvent for Alt Gr + 2 has the following structure:
|
|
||||||
// - altKey: false
|
// - altKey: false
|
||||||
// - code: "Digit2"
|
// - code: "Digit2"
|
||||||
// - type: ["keydown"|"keyup"]
|
// - type: [ "keydown" | "keyup" ]
|
||||||
//
|
//
|
||||||
// Adding and removing 0x40 (AltRight) from and to the list of active
|
// For context, filteredModifiers aims to keep track which modifiers
|
||||||
// modifiers is handled by keyUpHandler an keyDownHandler.
|
// are being pressed on the physical keyboard at any point in time.
|
||||||
|
// There is logic in the keyUpHandler and keyDownHandler to add and
|
||||||
|
// remove 0x40 (AltRight) from the list of new modifiers.
|
||||||
|
//
|
||||||
|
// But relying on the two handlers alone to track the state of the
|
||||||
|
// modifier bears the risk that the key up event for Alt Gr could
|
||||||
|
// get lost while the browser window is temporarily out of focus,
|
||||||
|
// which means the Alt Gr key state would then be "stuck". At this
|
||||||
|
// point, we would need to rely on the user to press Alt Gr again
|
||||||
|
// to properly release the state of that modifier.
|
||||||
.filter(
|
.filter(
|
||||||
modifier =>
|
modifier =>
|
||||||
altKey ||
|
altKey ||
|
||||||
|
|
Loading…
Reference in New Issue