2 * Copyright 2008-2011 Michael Lotz <mmlr@mlotz.ch>
3 * Distributed under the terms of the MIT license.
5 #ifndef USB_MOUSE_PROTOCOL_HANDLER_H
6 #define USB_MOUSE_PROTOCOL_HANDLER_H
9 #include <InterfaceDefs.h>
11 #include "ProtocolHandler.h"
18 #ifndef B_MAX_MOUSE_BUTTONS
19 # define B_MAX_MOUSE_BUTTONS 8
23 class MouseProtocolHandler
: public ProtocolHandler
{
25 MouseProtocolHandler(HIDReport
&report
,
27 HIDReportItem
&yAxis
);
29 static void AddHandlers(HIDDevice
&device
,
30 HIDCollection
&collection
,
31 ProtocolHandler
*&handlerList
);
33 virtual status_t
Control(uint32
*cookie
, uint32 op
, void *buffer
,
37 status_t
_ReadReport(void *buffer
, uint32
*cookie
);
41 HIDReportItem
& fXAxis
;
42 HIDReportItem
& fYAxis
;
43 HIDReportItem
* fWheel
;
44 HIDReportItem
* fButtons
[B_MAX_MOUSE_BUTTONS
];
48 bigtime_t fLastClickTime
;
49 bigtime_t fClickSpeed
;
52 #endif // USB_MOUSE_PROTOCOL_HANDLER_H