mirror of https://github.com/jetkvm/kvm.git
Compare commits
3 Commits
fd06797124
...
2a9622b457
Author | SHA1 | Date |
---|---|---|
|
2a9622b457 | |
|
294198a126 | |
|
3b293ff37f |
|
@ -330,11 +330,18 @@ 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 (AltGraph)
|
// If altKey is false, filter out 0x04 (AltLeft)
|
||||||
|
//
|
||||||
|
// Special case: Despite the Alt-Gr key being pressed, `altKey' on
|
||||||
|
// the event `e' is set to `false'. This means we cannot detect if Alt-Gr
|
||||||
|
// is being pressed while the user e.g. presses the `2' key. Instead, we
|
||||||
|
// we need to rely on keyUpHandler/keyDownHandler to toggle the state
|
||||||
|
// for 0x40 (AltRight) and avoid filtering for this code here, so that we
|
||||||
|
// can remember the state of the Alt-Gr modifier on subsequent key presses.
|
||||||
.filter(
|
.filter(
|
||||||
modifier =>
|
modifier =>
|
||||||
altKey ||
|
altKey ||
|
||||||
(modifier !== modifiers["AltLeft"] && modifier !== modifiers["AltGraph"]),
|
(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,3 +1,5 @@
|
||||||
|
// 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 = {
|
||||||
ArrowDown: 0x51,
|
ArrowDown: 0x51,
|
||||||
ArrowLeft: 0x50,
|
ArrowLeft: 0x50,
|
||||||
|
@ -97,6 +99,7 @@ export const keys = {
|
||||||
Tab: 0x2b,
|
Tab: 0x2b,
|
||||||
} as Record<string, number>;
|
} as Record<string, number>;
|
||||||
|
|
||||||
|
// Mapping from characters entered into "Paste text" box to key codes and modifiers
|
||||||
export const chars = {
|
export const chars = {
|
||||||
A: { key: "KeyA", shift: true },
|
A: { key: "KeyA", shift: true },
|
||||||
B: { key: "KeyB", shift: true },
|
B: { key: "KeyB", shift: true },
|
||||||
|
|
Loading…
Reference in New Issue