mirror of https://github.com/jetkvm/kvm.git
Merge 20f966c0ac
into d79f359c43
This commit is contained in:
commit
eced5b63fe
|
@ -330,11 +330,25 @@ export default function WebRTCVideo() {
|
||||||
)
|
)
|
||||||
// Alt: Keep if Alt is pressed or if the key isn't an Alt key
|
// Alt: Keep if Alt is pressed or if the key isn't an Alt key
|
||||||
// Example: If altKey is true, keep all modifiers
|
// Example: If altKey is true, keep all modifiers
|
||||||
// If altKey is false, filter out 0x04 (AltLeft) and 0x40 (AltRight)
|
// If altKey is false, filter out 0x04 (AltLeft)
|
||||||
|
//
|
||||||
|
// But intentionally do not filter out 0x40 (AltRight) to enable Alt Gr
|
||||||
|
// (Alt Graph) as a modifier. The altKey attribute is set to false on
|
||||||
|
// key combinations involving the Alt Gr key, which means the modifier
|
||||||
|
// would otherwise be unintentionally removed from the filteredModifiers
|
||||||
|
// list.
|
||||||
|
//
|
||||||
|
// For example, the KeyboardEvent for Alt Gr + 2 has the following structure:
|
||||||
|
// - altKey: false
|
||||||
|
// - code: "Digit2"
|
||||||
|
// - type: ["keydown"|"keyup"]
|
||||||
|
//
|
||||||
|
// Adding and removing 0x40 (AltRight) from and to the list of active
|
||||||
|
// modifiers is handled by keyUpHandler an keyDownHandler.
|
||||||
.filter(
|
.filter(
|
||||||
modifier =>
|
modifier =>
|
||||||
altKey ||
|
altKey ||
|
||||||
(modifier !== modifiers["AltLeft"] && modifier !== modifiers["AltRight"]),
|
(modifier !== modifiers["AltLeft"]),
|
||||||
)
|
)
|
||||||
// Meta: Keep if Meta is pressed or if the key isn't a Meta key
|
// Meta: Keep if Meta is pressed or if the key isn't a Meta key
|
||||||
// Example: If metaKey is true, keep all modifiers
|
// Example: If metaKey is true, keep all modifiers
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
// Key codes and modifiers correspond to definitions in the
|
||||||
|
// [Linux USB HID gadget driver](https://www.kernel.org/doc/Documentation/usb/gadget_hid.txt)
|
||||||
export const keys = {
|
export const keys = {
|
||||||
AltLeft: 0xe2,
|
|
||||||
AltRight: 0xe6,
|
|
||||||
ArrowDown: 0x51,
|
ArrowDown: 0x51,
|
||||||
ArrowLeft: 0x50,
|
ArrowLeft: 0x50,
|
||||||
ArrowRight: 0x4f,
|
ArrowRight: 0x4f,
|
||||||
|
|
Loading…
Reference in New Issue