module

HIDMouse

HID Mouse Module for USB Gadget functionality

Constants

Log = ::Log.for(self)
MOUSE_BUTTONS = {"left" => 1_u8, "right" => 2_u8, "middle" => 4_u8}

Mouse button mappings

Class methods

create_mouse_absolute_report(buttons : Array(String) = [] of String, x : Int32 = 0, y : Int32 = 0) : Bytes

Create an absolute mouse report (buttons + 16-bit absolute X/Y)

Source
create_mouse_report(buttons : Array(String) = [] of String, x_delta : Int32 = 0, y_delta : Int32 = 0, wheel : Int32 = 0) : Bytes
Source
send_mouse_absolute_move(device_path : String, x : Int32, y : Int32, buttons : Array(String) = [] of String)
Source
send_mouse_absolute_report(device_path : String, report : Bytes)
Source
send_mouse_click(device_path : String, button : String)
Source
send_mouse_move_with_buttons(device_path : String, x_delta : Int32, y_delta : Int32, buttons : Array(String))
Source
send_mouse_press(device_path : String, button : String)
Source
send_mouse_release(device_path : String, button : String)
Source
send_mouse_report(device_path : String, report : Bytes)
Source
send_mouse_wheel(device_path : String, wheel_delta : Int32)
Source