diff options
author | tmk <nobody@nowhere> | 2010-10-01 22:17:55 +0900 |
---|---|---|
committer | tmk <nobody@nowhere> | 2010-10-01 22:17:55 +0900 |
commit | 7e3975e0ef00b2095e32595597ba054d408f249c (patch) | |
tree | 572c5df747df8b29dfffd2dbe26adc4606a29c54 /usb_mouse.c | |
parent | d3b1af9572e123c939fc355474bf12402c86d292 (diff) |
add mouse wheel function.
Diffstat (limited to 'usb_mouse.c')
-rw-r--r-- | usb_mouse.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usb_mouse.c b/usb_mouse.c index 539f2edd37..a3992efbc6 100644 --- a/usb_mouse.c +++ b/usb_mouse.c @@ -22,11 +22,11 @@ int8_t usb_mouse_buttons(uint8_t left, uint8_t middle, uint8_t right) if (middle) mask |= 4; if (right) mask |= 2; mouse_buttons = mask; - return usb_mouse_move(0, 0, 0); + return usb_mouse_move(0, 0, 0, 0); } // Move the mouse. x, y and wheel are -127 to 127. Use 0 for no movement. -int8_t usb_mouse_move(int8_t x, int8_t y, int8_t wheel) +int8_t usb_mouse_move(int8_t x, int8_t y, int8_t wheel, int8_t hwheel) { uint8_t intr_state, timeout; @@ -34,6 +34,7 @@ int8_t usb_mouse_move(int8_t x, int8_t y, int8_t wheel) if (x == -128) x = -127; if (y == -128) y = -127; if (wheel == -128) wheel = -127; + if (hwheel == -128) hwheel = -127; intr_state = SREG; cli(); UENUM = MOUSE_ENDPOINT; @@ -55,8 +56,8 @@ int8_t usb_mouse_move(int8_t x, int8_t y, int8_t wheel) UEDATX = x; UEDATX = y; UEDATX = wheel; + //UEDATX = hwheel; UEINTX = 0x3A; SREG = intr_state; return 0; } - |