Gadget: MOUSE0 descriptor to variable

This commit is contained in:
Petr Kracik 2020-06-05 13:20:12 +02:00
parent 7d37ff9696
commit d077d034aa

View File

@ -5,6 +5,20 @@ gserial=$(awk '/Serial/ { print $3 }' /proc/cpuinfo)
gmanufacturer="Petrkr.NET" gmanufacturer="Petrkr.NET"
gproduct="rPi KVM" gproduct="rPi KVM"
#Mouse 0 relative descriptor
MOUSE0=""
MOUSE0="$MOUSE0\\x05\\x01\\x09\\x02" # Usage generic desktop, Usage mouse
MOUSE0="$MOUSE0\\xa1\\x01\\x09\\x01" # Collection App, Usage Pointer
MOUSE0="$MOUSE0\\xa1\\x00" # Collection Physical
MOUSE0="$MOUSE0\\x05\\x09" # Use Page buttons
MOUSE0="$MOUSE0\\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
MOUSE0="$MOUSE0\\x81\\x02" # Input data, variable, absolute
MOUSE0="$MOUSE0\\x05\\x01" # Usage page generic desktop
MOUSE0="$MOUSE0\\x09\\x30\\x09\\x31\\x09\\x38\\x15\\x81\\x25\\x7f\\x75\\x08\\x95\\x03" # Usage X,Y,Wheel, Log min -127, log max 127, size 8, report 3
MOUSE0="$MOUSE0\\x81\\x02" # Input data, variable, absolute
MOUSE0="$MOUSE0\\xc0" # End collection Physical
MOUSE0="$MOUSE0\\xc0" # End collection Application
#Mouse 1 absolute descriptor #Mouse 1 absolute descriptor
MOUSE1="" MOUSE1=""
MOUSE1="$MOUSE1\\x05\\x01\\x09\\x02" # Usage generic desktop, Usage mouse MOUSE1="$MOUSE1\\x05\\x01\\x09\\x02" # Usage generic desktop, Usage mouse
@ -56,7 +70,7 @@ mkdir -p functions/hid.mouse0
echo 2 > functions/hid.mouse0/protocol echo 2 > functions/hid.mouse0/protocol
echo 1 > functions/hid.mouse0/subclass echo 1 > functions/hid.mouse0/subclass
echo 8 > functions/hid.mouse0/report_length echo 8 > functions/hid.mouse0/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\\x81\\x25\\x7f\\x75\\x08\\x95\\x03\\x81\\x06\\xc0\\xc0 > functions/hid.mouse0/report_desc echo -ne $MOUSE0 > functions/hid.mouse0/report_desc
echo " HID Mouse Absolute" echo " HID Mouse Absolute"
mkdir -p functions/hid.mouse1 mkdir -p functions/hid.mouse1