From a77ae5f84312e295daabfdc46c79a627b84fee4f Mon Sep 17 00:00:00 2001 From: tmk Date: Thu, 18 Apr 2013 15:51:14 +0900 Subject: Add support of iWRAP5 - mouse virtical wheel - consumer page --- protocol/iwrap/iwrap.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'protocol/iwrap/iwrap.c') diff --git a/protocol/iwrap/iwrap.c b/protocol/iwrap/iwrap.c index 3cc9ca3061..d65d9e38ef 100644 --- a/protocol/iwrap/iwrap.c +++ b/protocol/iwrap/iwrap.c @@ -334,7 +334,7 @@ static void send_keyboard(report_keyboard_t *report) // HID raw mode header xmit(0x9f); xmit(0x0a); // Length - xmit(0xa1); // keyboard report + xmit(0xa1); // DATA(Input) xmit(0x01); xmit(report->mods); xmit(0x00); // reserved byte(always 0) @@ -355,9 +355,16 @@ static void send_mouse(report_mouse_t *report) // HID raw mode header xmit(0x9f); xmit(0x05); // Length - xmit(0xa1); // mouse report + xmit(0xa1); // DATA(Input) xmit(0x02); - xmit(report->buttons); + /* vertical wheel support */ + int8_t wheel = report->v; + if (wheel < -15) { + wheel = -15; + } else if (wheel > 15) { + wheel = 15; + } + xmit(((wheel&0x1f)<<3) | (report->buttons&0x07)); xmit(report->x); xmit(report->y); MUX_FOOTER(0x01); @@ -457,7 +464,7 @@ static void send_consumer(uint16_t data) MUX_HEADER(0x01, 0x07); xmit(0x9f); xmit(0x05); // Length - xmit(0xa1); // consumer report + xmit(0xa1); // DATA(Input) xmit(0x03); xmit(bits1); xmit(bits2); -- cgit v1.2.3 From 663027751831eb0e80d64c90aaf82d2921533aed Mon Sep 17 00:00:00 2001 From: tmk Date: Fri, 19 Apr 2013 23:43:52 +0900 Subject: Add support of mouse horizontal wheel to iWRAP --- protocol/iwrap/iwrap.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'protocol/iwrap/iwrap.c') diff --git a/protocol/iwrap/iwrap.c b/protocol/iwrap/iwrap.c index d65d9e38ef..6a404116a1 100644 --- a/protocol/iwrap/iwrap.c +++ b/protocol/iwrap/iwrap.c @@ -335,7 +335,7 @@ static void send_keyboard(report_keyboard_t *report) xmit(0x9f); xmit(0x0a); // Length xmit(0xa1); // DATA(Input) - xmit(0x01); + xmit(0x01); // Report ID xmit(report->mods); xmit(0x00); // reserved byte(always 0) xmit(report->keys[0]); @@ -351,22 +351,17 @@ static void send_mouse(report_mouse_t *report) { #if defined(MOUSEKEY_ENABLE) || defined(PS2_MOUSE_ENABLE) if (!iwrap_connected() && !iwrap_check_connection()) return; - MUX_HEADER(0x01, 0x07); + MUX_HEADER(0x01, 0x09); // HID raw mode header xmit(0x9f); - xmit(0x05); // Length + xmit(0x07); // Length xmit(0xa1); // DATA(Input) - xmit(0x02); - /* vertical wheel support */ - int8_t wheel = report->v; - if (wheel < -15) { - wheel = -15; - } else if (wheel > 15) { - wheel = 15; - } - xmit(((wheel&0x1f)<<3) | (report->buttons&0x07)); + xmit(0x02); // Report ID + xmit(report->buttons); xmit(report->x); xmit(report->y); + xmit(report->v); + xmit(report->h); MUX_FOOTER(0x01); #endif } @@ -465,7 +460,7 @@ static void send_consumer(uint16_t data) xmit(0x9f); xmit(0x05); // Length xmit(0xa1); // DATA(Input) - xmit(0x03); + xmit(0x03); // Report ID xmit(bits1); xmit(bits2); xmit(bits3); -- cgit v1.2.3