|
@@ -14,7 +14,7 @@ const (
|
|
|
EventTypeHIDCommand
|
|
|
)
|
|
|
|
|
|
-const MinCusorEventInterval = 40 // Minimum interval between cursor events in milliseconds
|
|
|
+const MinCusorEventInterval = 30 // Minimum interval between cursor events in milliseconds
|
|
|
|
|
|
type Config struct {
|
|
|
/* Serial port configs */
|
|
@@ -47,13 +47,14 @@ type Controller struct {
|
|
|
}
|
|
|
|
|
|
type HIDCommand struct {
|
|
|
- Event EventType `json:"event"`
|
|
|
- Keycode int `json:"keycode,omitempty"`
|
|
|
- IsRightModKey bool `json:"is_right_modifier_key,omitempty"` // true if the key is a right modifier key (Ctrl, Shift, Alt, GUI)
|
|
|
- MouseAbsX int `json:"mouse_x,omitempty"` // Absolute mouse position in X direction
|
|
|
- MouseAbsY int `json:"mouse_y,omitempty"` // Absolute mouse position in Y direction
|
|
|
- MouseRelX int `json:"mouse_rel_x,omitempty"` // Relative mouse movement in X direction
|
|
|
- MouseRelY int `json:"mouse_rel_y,omitempty"` // Relative mouse movement in Y direction
|
|
|
- MouseButton int `json:"mouse_button,omitempty"` //0x01 for left click, 0x02 for right click, 0x03 for middle clicks
|
|
|
- MouseScroll int `json:"mouse_scroll,omitempty"` // Positive for scroll up, negative for scroll down, max 127
|
|
|
+ Event EventType `json:"event"`
|
|
|
+ Keycode int `json:"keycode,omitempty"`
|
|
|
+ IsRightModKey bool `json:"is_right_modifier_key,omitempty"` // true if the key is a right modifier key (Ctrl, Shift, Alt, GUI)
|
|
|
+ MouseAbsX int `json:"mouse_x,omitempty"` // Absolute mouse position in X direction
|
|
|
+ MouseAbsY int `json:"mouse_y,omitempty"` // Absolute mouse position in Y direction
|
|
|
+ MouseRelX int `json:"mouse_rel_x,omitempty"` // Relative mouse movement in X direction
|
|
|
+ MouseRelY int `json:"mouse_rel_y,omitempty"` // Relative mouse movement in Y direction
|
|
|
+ MouseMoveButtonState int `json:"mouse_move_button_state,omitempty"` // Mouse button state during move,
|
|
|
+ MouseButton int `json:"mouse_button,omitempty"` //0x01 for left click, 0x02 for right click, 0x03 for middle clicks
|
|
|
+ MouseScroll int `json:"mouse_scroll,omitempty"` // Positive for scroll up, negative for scroll down, max 127
|
|
|
}
|