Gadget: MOUSE1 descriptor to variable, separated wheel
This commit is contained in:
parent
fe08a9574d
commit
7d37ff9696
@ -5,6 +5,23 @@ gserial=$(awk '/Serial/ { print $3 }' /proc/cpuinfo)
|
||||
gmanufacturer="Petrkr.NET"
|
||||
gproduct="rPi KVM"
|
||||
|
||||
#Mouse 1 absolute descriptor
|
||||
MOUSE1=""
|
||||
MOUSE1="$MOUSE1\\x05\\x01\\x09\\x02" # Usage generic desktop, Usage mouse
|
||||
MOUSE1="$MOUSE1\\xa1\\x01\\x09\\x01" # Collection App, Usage Pointer
|
||||
MOUSE1="$MOUSE1\\xa1\\x00" # Collection Physical
|
||||
MOUSE1="$MOUSE1\\x05\\x09" # Use Page buttons
|
||||
MOUSE1="$MOUSE1\\x19\\x01\\x29\\x08\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08" # Usage min 1, max 8, logical min 0, max 1, report 8, size 1
|
||||
MOUSE1="$MOUSE1\\x81\\x02" # Input data, variable, absolute
|
||||
MOUSE1="$MOUSE1\\x05\\x01" # Usage page generic desktop
|
||||
MOUSE1="$MOUSE1\\x09\\x30\\x09\\x31\\x15\\x00\\x25\\xff\\x75\\x08\\x95\\x02" # Usage X,Y, Log min 0, log max 255, size 8, report 2
|
||||
MOUSE1="$MOUSE1\\x81\\x02" # Input data, variable, absolute
|
||||
MOUSE1="$MOUSE1\\x05\\x01" # Usage page generic desktop
|
||||
MOUSE1="$MOUSE1\\x09\\x38\\x15\\x81\\x25\\x7f\\x75\\x08\\x95\\x01" # Usage Wheel, log min -127, max 127, size 8, report 1
|
||||
MOUSE1="$MOUSE1\\x81\\x06" # Input data, variable, relative
|
||||
MOUSE1="$MOUSE1\\xc0" # End collection Physical
|
||||
MOUSE1="$MOUSE1\\xc0" # End collection Application
|
||||
|
||||
cd /sys/kernel/config/usb_gadget/
|
||||
mkdir -p $gname
|
||||
cd $gname
|
||||
@ -46,7 +63,7 @@ mkdir -p functions/hid.mouse1
|
||||
echo 2 > functions/hid.mouse1/protocol
|
||||
echo 1 > functions/hid.mouse1/subclass
|
||||
echo 8 > functions/hid.mouse1/report_length
|
||||
echo -ne \\x05\\x01\\x09\\x02\\xa1\\x01\\x09\\x01\\xa1\\x00\\x05\\x09\\x19\\x01\\x29\\x08\\x15\\x00\\x25\\x01\\x95\\x08\\x75\\x01\\x81\\x02\\x05\\x01\\x09\\x30\\x09\\x31\\x09\\x38\\x15\\x00\\x25\\xff\\x75\\x08\\x95\\x03\\x81\\x02\\xc0\\xc0 > functions/hid.mouse1/report_desc
|
||||
echo -ne $MOUSE1 > functions/hid.mouse1/report_desc
|
||||
|
||||
|
||||
echo " Mass storage"
|
||||
|
@ -16,11 +16,18 @@ a1 01 // Collection Application
|
||||
05 01 // Usage Page Generic Desktop
|
||||
09 30 // Usage X
|
||||
09 31 // Usage Y
|
||||
15 00 // Logical Min ( 0)
|
||||
25 FF // Logical Max ( 255)
|
||||
75 08 // Report size 8
|
||||
95 02 // Report count 2
|
||||
81 02 // Input Data, Variable, Absolute
|
||||
|
||||
05 01 // Usage Page Generic Desktop
|
||||
09 38 // Usage Wheel
|
||||
15 81 // Logical Min (-127)
|
||||
25 7f // Logical Max ( 127)
|
||||
75 08 // Report size 8
|
||||
95 03 // Report count 3
|
||||
95 01 // Report count 1
|
||||
81 06 // Input Data, Variable, Relative
|
||||
|
||||
c0 // End collection
|
||||
|
Loading…
Reference in New Issue
Block a user