Documentation ¶
Index ¶
- Constants
- Variables
- func GetDisconnectedDevices(adapterId string) ([]string, error)
- func HandleKeyboard(output chan<- error, input chan<- InputMessage, close <-chan bool, rate uint, ...) error
- func HandleMouse(output chan<- error, input chan<- InputMessage, close <-chan bool, ...) error
- func SendKeyboardReports(input <-chan InputMessage) error
- func SendMouseReports(input <-chan InputMessage) error
- func SetupUSBGadget()
- func Start(config Config)
- type Config
- type InputDevice
- type InputMessage
Constants ¶
View Source
const ( RIGHT_META = 1 << 7 RIGHT_ALT = 1 << 6 RIGHT_SHIFT = 1 << 5 RIGHT_CONTROL = 1 << 4 LEFT_META = 1 << 3 LEFT_ALT = 1 << 2 LEFT_SHIFT = 1 << 1 LEFT_CONTROL = 1 << 0 BUTTON_LEFT = 1 << 0 BUTTON_RIGHT = 1 << 1 BUTTON_MIDDLE = 1 << 2 )
Variables ¶
View Source
var Scancodes = map[uint16]uint16{
2: 30,
3: 31,
4: 32,
5: 33,
6: 34,
7: 35,
8: 36,
9: 37,
10: 38,
11: 39,
57: 44,
14: 42,
28: 40,
1: 41,
106: 79,
105: 80,
108: 81,
103: 82,
59: 58,
60: 59,
61: 60,
62: 61,
63: 62,
64: 63,
65: 64,
66: 65,
67: 66,
68: 67,
69: 68,
70: 69,
12: 45,
13: 46,
15: 43,
26: 47,
27: 48,
39: 51,
40: 52,
51: 54,
52: 55,
53: 56,
41: 50,
43: 49,
30: 4,
48: 5,
46: 6,
32: 7,
18: 8,
33: 9,
34: 10,
35: 11,
23: 12,
36: 13,
37: 14,
38: 15,
50: 16,
49: 17,
24: 18,
25: 19,
16: 20,
19: 21,
31: 22,
20: 23,
22: 24,
47: 25,
17: 26,
45: 27,
21: 28,
44: 29,
86: 49,
104: 75,
109: 78,
102: 74,
107: 77,
110: 73,
119: 72,
99: 70,
87: 68,
88: 69,
113: 127,
114: 129,
115: 128,
58: 57,
158: 122,
159: 121,
29: 224,
125: 227,
42: 225,
56: 226,
100: 230,
127: 231,
97: 228,
54: 229,
111: 76,
164: 232,
165: 234,
163: 233,
}
Functions ¶
func GetDisconnectedDevices ¶
func HandleKeyboard ¶
func HandleKeyboard(output chan<- error, input chan<- InputMessage, close <-chan bool, rate uint, delay uint, dev evdev.InputDevice) error
func HandleMouse ¶
func HandleMouse(output chan<- error, input chan<- InputMessage, close <-chan bool, dev evdev.InputDevice) error
func SendKeyboardReports ¶
func SendKeyboardReports(input <-chan InputMessage) error
func SendMouseReports ¶
func SendMouseReports(input <-chan InputMessage) error
func SetupUSBGadget ¶
func SetupUSBGadget()
Types ¶
type InputDevice ¶
type InputMessage ¶
Click to show internal directories.
Click to hide internal directories.