From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from duke.felloff.net ([216.126.196.34]) by ur; Wed Sep 28 09:27:34 EDT 2016 Message-ID: <26ec0414aae69efe7db6547d61ac1a67@felloff.net> Date: Wed, 28 Sep 2016 15:27:28 +0200 From: cinap_lenrek@felloff.net To: 9front@9front.org Subject: Re: [9front] Middle button on usb mice In-Reply-To: <20160928021342.GA2003@speakerbox> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: map/reduce self-signing-aware generator >> the debug output including the descriptor would be usefull. show what >> it outputs when you click the middle mouse button. > report descriptor: > 0x05 0x01 0x09 0x02 0xa1 0x01 0x09 0x01 > 0xa1 0x00 0x05 0x09 0x19 0x01 0x29 0x03 > 0x15 0x00 0x25 0x01 0x95 0x08 0x75 0x01 > 0x81 0x02 0x05 0x01 0x09 0x30 0x09 0x31 > 0x09 0x38 0x15 0x81 0x25 0x7f 0x75 0x08 > 0x95 0x03 0x81 0x06 0xc0 0xc0 that decodes to: 0x05 0x01 USAGE PAGE(GENERIC DESKTOP) 0x09 0x02 USAGE (Mouse) 0xa1 0x01 COLLECTION (Application) 0x09 0x01 USAGE (Pointer) 0xa1 0x00 COLLECTION (Physical) 0x05 0x09 USAGE PAGE(Button) 0x19 0x01 USAGE MINIMUM (Button1) 0x29 0x03 USAGE MAXIMUM (Button3) 0x15 0x00 LOCAL MINIMUM (0) 0x25 0x01 LOCAL MAXIMUM (1) 0x95 0x08 REPORT COUNT (8) 0x75 0x01 REPORT SIZE (1) 0x81 0x02 INPUT (Data,Var,Abs) 0x05 0x01 USAGE 0x09 0x30 X 0x09 0x31 Y 0x09 0x38 WHEEL 0x15 0x81 Logical min -127 0x25 0x7f Logical max 127 0x75 0x08 REPORT SIZE(8) 0x95 0x03 REPORT COUNT(3) 0x81 0x06 INPUT (Data,Var,Rel) 0xc0 END COLLECTION 0xc0 END COLLECTION note that it maps the buttons 1-3 to bits 0-7 of the first byte; meaning there are more bits than buttons. normally, the buttons are mapped like 1-3 -> bits 0-2, and then theres a dummy report count(1), report size(5) to cover the rest of the byte. > hidparse: t=8 f=2 usage=90001 v=0 # button1 > hidparse: t=8 f=2 usage=90002 v=0 # button2 > hidparse: t=8 f=2 usage=90003 v=0 > hidparse: t=8 f=2 usage=90003 v=0 > hidparse: t=8 f=2 usage=90003 v=0 > hidparse: t=8 f=2 usage=90003 v=0 > hidparse: t=8 f=2 usage=90003 v=0 > hidparse: t=8 f=2 usage=90003 v=0 # button3 button3 item is reported multiple times here (for bits 2-7 of the first byte) > hidparse: t=8 f=6 usage=10030 v=0 # X > hidparse: t=8 f=6 usage=10031 v=0 # Y > hidparse: t=8 f=6 usage=10038 v=0 # Z this indeed explains why the middle button doesnt work, but not why the mouse wheel doesnt work... i'll look in the specification when i get home to see if it sais anything about disabiguating the max usage vs. report count case. anyway, the packet format is 1 byte buttons, and then 3 bytes X,Y,Z in the report packet. you can hexdump these and veryfy that button3 indeed asserts bit 2 in the first byte. -- cinap