diff options
Diffstat (limited to 'mousetsr.h')
-rw-r--r-- | mousetsr.h | 36 |
1 files changed, 24 insertions, 12 deletions
@@ -34,8 +34,10 @@ #define USE_VMWARE 1 /** Enable Windows 386/protected mode integration .*/ #define USE_WIN386 1 -/** Enable the wheel. */ +/** Enable the wheel (and ImPS/2 protocol). */ #define USE_WHEEL 1 +/** Enable Intellimouse Explorer protocol (two wheels and 5 buttons). */ +#define USE_IMEX 1 /** Trace mouse events verbosily. */ #define TRACE_EVENTS 0 /** Trace (noisy) API calls. */ @@ -57,8 +59,11 @@ /** Maximum number of 55ms ticks that may pass between two bytes of the same PS/2 packet */ #define MAX_PS2_PACKET_DELAY 2 -/** Number of buttons reported back to user programs. */ -#define NUM_BUTTONS 3 +/** Maximum number of buttons supported by this driver. */ +#define MAX_BUTTONS 5 + +/** Maximum number of wheels supported. */ +#define MAX_WHEELS 2 /** Size of int33 graphic cursor shape definitions. */ #define GRAPHIC_CURSOR_WIDTH 16 @@ -110,9 +115,13 @@ typedef struct tsrdata { struct point screen_granularity; // Detected mouse hardware & status + /** Current negotiated PS/2 device_id */ + uint8_t device_id; + /** Number of buttons of current device. */ + uint8_t num_buttons; #if USE_WHEEL - /** Whether the current mouse has a wheel (and support is enabled). */ - bool haswheel; + /** Number of wheels of current device. */ + uint8_t num_wheels; #endif /** Packet size that the BIOS is currently using. Either 1 (streaming) or 3 (plain). */ uint8_t bios_packet_size; @@ -168,18 +177,21 @@ typedef struct tsrdata { /** Ticks when the above value was last reset. */ uint16_t last_motion_ticks; /** Current status of buttons (as bitfield). */ - uint16_t buttons; + uint8_t buttons; struct { struct buttoncounter { struct point last; uint16_t count; } pressed, released; - } button[NUM_BUTTONS]; - /** Total delta movement of the wheel since the last wheel report. */ - int16_t wheel_delta; - /** Last position where the wheel was moved. */ - struct point wheel_last; - + } button[MAX_BUTTONS]; +#if USE_WHEEL + struct wheelcounter { + /** Total delta movement of the wheel since the last wheel report. */ + int16_t delta; + /** Last position where the wheel was moved. */ + struct point last; + } wheel[MAX_WHEELS]; +#endif // Cursor information /** Whether the cursor is currently displayed or not. */ bool cursor_visible; |