<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forums.obdev.at/app.php/feed/topic/3002" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2009-07-14T22:01:29+02:00</updated>

	<author><name><![CDATA[Objective Development Forums]]></name></author>
	<id>https://forums.obdev.at/app.php/feed/topic/3002</id>

		<entry>
		<author><name><![CDATA[vputz]]></name></author>
		<updated>2009-07-14T22:01:29+02:00</updated>

		<published>2009-07-14T22:01:29+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3002&amp;p=10151#p10151</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3002&amp;p=10151#p10151"/>
		<title type="html"><![CDATA[Re: Composite Joy/Key/Mouse report descriptor failing....]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3002&amp;p=10151#p10151"><![CDATA[
Looks like I fixed it; not sure what the problem was but I broke the joystick report into a four-axis 16-button report and a separate two-axis report (for the lesser-used axes).  Now it seems to work OK; haven't tried it with full device operation yet (ie joystick+mouse+kbd) but that is coming.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=2308">vputz</a> — Tue Jul 14, 2009 10:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[vputz]]></name></author>
		<updated>2009-07-13T21:01:13+02:00</updated>

		<published>2009-07-13T21:01:13+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3002&amp;p=10129#p10129</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3002&amp;p=10129#p10129"/>
		<title type="html"><![CDATA[Composite Joy/Key/Mouse report descriptor failing....]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3002&amp;p=10129#p10129"><![CDATA[
I'm working on a device which acts as a composite joystick/mouse/keyboard-- and actually made it quite far using three different report IDs.  Unfortunately, the joystick report was quite long (6 axes at  10 bits apiece plus 16 buttons, plus a byte for the report ID meant I needed to do the &quot;send 8 bytes, poll, send more bytes&quot; trick).<br /><br />Now, that seemed to be a problem because as soon as I sent an interesting joystick report descriptor, Windows hated my device (and declared it invalid, etc).  If, however, I stuck with keyboard and mouse reports, all seemed well.<br /><br />At a guess, I tried splitting up the joystick report into two separate reports (figuring that maybe the &quot;send 8 bytes, poll, send more bytes&quot; trick was getting confused with multiple report IDs).  The HID report descriptor tool parsed this without difficulty, but Windows says that the device &quot;is not recognized&quot; and refuses to even try.  I'm flailing a bit with usage pages and such, but Windows seemed OK with the descriptor when the joystick report was one report rather than split up like this.<br /><br />So now I have four reports<br />Joystick report 1 (3 axes at 10 bits, 2 bits constant = 32 bits)<br />Joystick report 2 (3 axes at 10 bits, 2 bits constant, 16 bits for buttons = 48 bits)<br />Keyboard report (8 bits modifiers, 40 bits for 5 simultaneous keys = 48 bits)<br />Mouse report (3 bits buttons, 5 bits const, 3x8 bits axes, 32 bits)<br /><br />...but I never get that far, as Windows says &quot;unknown device&quot;.  It worked OK with the two joystick reports as one (6 axes at 10 bits, 16 bits for buttons, 4 bits const = 80 bits).<br /><br />Any suggestions?  Here's the &quot;frankenreport&quot; descriptor (from the hid report descriptor tool; in my V-USB code of course it's PROGMEM with  USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH set to 171):<br /><div class="codebox"><p>Code: </p><pre><code>char ReportDescriptor&#91;171&#93; = {<br />    0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)<br />    0x09, 0x04,                    // USAGE (Joystick)<br />    0xa1, 0x01,                    // COLLECTION (Application)<br />    0x85, 0x04,                    //   REPORT_ID (4)<br />    0xa1, 0x00,                    //   COLLECTION (Physical)<br />    0x09, 0x30,                    //     USAGE (X)<br />    0x09, 0x31,                    //     USAGE (Y)<br />    0x09, 0x32,                    //     USAGE (Z)<br />    0x15, 0x00,                    //     LOGICAL_MINIMUM (0)<br />    0x26, 0xff, 0x03,              //     LOGICAL_MAXIMUM (1023)<br />    0x75, 0x0a,                    //     REPORT_SIZE (10)<br />    0x95, 0x03,                    //     REPORT_COUNT (3)<br />    0x81, 0x02,                    //     INPUT (Data,Var,Abs)<br />    0x75, 0x02,                    //     REPORT_SIZE (2)<br />    0x95, 0x01,                    //     REPORT_COUNT (1)<br />    0x81, 0x03,                    //     INPUT (Cnst,Var,Abs)<br />    0x85, 0x05,                    //     REPORT_ID (5)<br />    0x09, 0x33,                    //     USAGE (Rx)<br />    0x09, 0x34,                    //     USAGE (Ry)<br />    0x09, 0x35,                    //     USAGE (Rz)<br />    0x15, 0x00,                    //     LOGICAL_MINIMUM (0)<br />    0x26, 0xff, 0x03,              //     LOGICAL_MAXIMUM (1023)<br />    0x75, 0x0a,                    //     REPORT_SIZE (10)<br />    0x95, 0x03,                    //     REPORT_COUNT (3)<br />    0x81, 0x02,                    //     INPUT (Data,Var,Abs)<br />    0x75, 0x02,                    //     REPORT_SIZE (2)<br />    0x95, 0x01,                    //     REPORT_COUNT (1)<br />    0x81, 0x03,                    //     INPUT (Cnst,Var,Abs)<br />    0xc0,                          //   END_COLLECTION<br />    0x05, 0x09,                    //   USAGE_PAGE (Button)<br />    0x19, 0x01,                    //   USAGE_MINIMUM (Button 1)<br />    0x29, 0x10,                    //   USAGE_MAXIMUM (Button 16)<br />    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)<br />    0x25, 0x01,                    //   LOGICAL_MAXIMUM (1)<br />    0x75, 0x01,                    //   REPORT_SIZE (1)<br />    0x95, 0x10,                    //   REPORT_COUNT (16)<br />    0x55, 0x00,                    //   UNIT_EXPONENT (0)<br />    0x65, 0x00,                    //   UNIT (None)<br />    0x81, 0x02,                    //   INPUT (Data,Var,Abs)<br />    0xc0,                          // END_COLLECTION<br />    0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)<br />    0x09, 0x06,                    // USAGE (Keyboard)<br />    0xa1, 0x01,                    // COLLECTION (Application)<br />    0x85, 0x02,                    //   REPORT_ID (2)<br />    0x05, 0x07,                    //   USAGE_PAGE (Keyboard)<br />    0x19, 0xe0,                    //   USAGE_MINIMUM (Keyboard LeftControl)<br />    0x29, 0xe7,                    //   USAGE_MAXIMUM (Keyboard Right GUI)<br />    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)<br />    0x25, 0x01,                    //   LOGICAL_MAXIMUM (1)<br />    0x75, 0x01,                    //   REPORT_SIZE (1)<br />    0x95, 0x08,                    //   REPORT_COUNT (8)<br />    0x81, 0x02,                    //   INPUT (Data,Var,Abs)<br />    0x95, 0x05,                    //   REPORT_COUNT (5)<br />    0x75, 0x08,                    //   REPORT_SIZE (8)<br />    0x25, 0x65,                    //   LOGICAL_MAXIMUM (101)<br />    0x19, 0x00,                    //   USAGE_MINIMUM (Reserved (no event indicated))<br />    0x29, 0x65,                    //   USAGE_MAXIMUM (Keyboard Application)<br />    0x81, 0x00,                    //   INPUT (Data,Ary,Abs)<br />    0xc0,                          // END_COLLECTION<br />    0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)<br />    0x09, 0x02,                    // USAGE (Mouse)<br />    0xa1, 0x01,                    // COLLECTION (Application)<br />    0x85, 0x03,                    //   REPORT_ID (3)<br />    0x09, 0x01,                    //   USAGE (Pointer)<br />    0xa1, 0x00,                    //   COLLECTION (Physical)<br />    0x05, 0x09,                    //     USAGE_PAGE (Button)<br />    0x19, 0x01,                    //     USAGE_MINIMUM (Button 1)<br />    0x29, 0x03,                    //     USAGE_MAXIMUM (Button 3)<br />    0x15, 0x00,                    //     LOGICAL_MINIMUM (0)<br />    0x25, 0x01,                    //     LOGICAL_MAXIMUM (1)<br />    0x95, 0x03,                    //     REPORT_COUNT (3)<br />    0x75, 0x01,                    //     REPORT_SIZE (1)<br />    0x81, 0x02,                    //     INPUT (Data,Var,Abs)<br />    0x95, 0x01,                    //     REPORT_COUNT (1)<br />    0x75, 0x05,                    //     REPORT_SIZE (5)<br />    0x81, 0x03,                    //     INPUT (Cnst,Var,Abs)<br />    0x05, 0x01,                    //     USAGE_PAGE (Generic Desktop)<br />    0x09, 0x30,                    //     USAGE (X)<br />    0x09, 0x31,                    //     USAGE (Y)<br />    0x09, 0x38,                    //     USAGE (Wheel)<br />    0x15, 0x81,                    //     LOGICAL_MINIMUM (-127)<br />    0x25, 0x7f,                    //     LOGICAL_MAXIMUM (127)<br />    0x75, 0x08,                    //     REPORT_SIZE (8)<br />    0x95, 0x03,                    //     REPORT_COUNT (3)<br />    0x81, 0x06,                    //     INPUT (Data,Var,Rel)<br />    0xc0,                          //   END_COLLECTION<br />    0xc0                           // END_COLLECTION<br />};<br /><br /></code></pre></div><br /><br />This is really killing me, because the keyboard/mouse code works a treat and the joystick code used to work, but I can't seem to get a report descriptor that makes windows happy with all 3... there are  a few people using this project already and I'm gutted that I've got it at an absolute standstill.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=2308">vputz</a> — Mon Jul 13, 2009 9:01 pm</p><hr />
]]></content>
	</entry>
	</feed>
