summaryrefslogtreecommitdiff
path: root/protocol/iwrap/iwrap.c
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-04-18 15:51:14 +0900
committertmk <nobody@nowhere>2013-04-18 15:52:23 +0900
commita77ae5f84312e295daabfdc46c79a627b84fee4f (patch)
treeda558b5f16f35f52ed6de6047fe547c4423b8fe2 /protocol/iwrap/iwrap.c
parent1eb67303ee7b8a037d035e97ffd2d19b030fe3f2 (diff)
Add support of iWRAP5
- mouse virtical wheel - consumer page
Diffstat (limited to 'protocol/iwrap/iwrap.c')
-rw-r--r--protocol/iwrap/iwrap.c15
1 files changed, 11 insertions, 4 deletions
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);