9front - general discussion about 9front
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9front@9front.org
Subject: Re: [9front] Middle button on usb mice
Date: Wed, 28 Sep 2016 15:27:28 +0200	[thread overview]
Message-ID: <26ec0414aae69efe7db6547d61ac1a67@felloff.net> (raw)
In-Reply-To: <20160928021342.GA2003@speakerbox>


>> 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


  reply	other threads:[~2016-09-28 13:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-24  3:26 lemon
2016-09-24 13:03 ` [9front] " cinap_lenrek
2016-09-26 23:13   ` lemon
2016-09-26 23:30     ` cinap_lenrek
2016-09-28  2:13       ` lemon
2016-09-28 13:27         ` cinap_lenrek [this message]
2016-09-28 14:20         ` cinap_lenrek
2016-09-30  3:47           ` lemon
2016-09-30  6:41             ` cinap_lenrek
2016-10-18  0:46               ` lemon
2016-09-30  7:37             ` cinap_lenrek
2016-09-30  7:40               ` cinap_lenrek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=26ec0414aae69efe7db6547d61ac1a67@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).