mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-08 23:12:27 +00:00
add support for mice with more than 3 buttons and one scroll wheel (Chris
B)
This commit is contained in:
parent
516f452e78
commit
c4083511ac
7 changed files with 79 additions and 10 deletions
|
|
@ -64,23 +64,26 @@ winMouseCtrl (DeviceIntPtr pDevice, PtrCtrl *pCtrl)
|
|||
int
|
||||
winMouseProc (DeviceIntPtr pDeviceInt, int iState)
|
||||
{
|
||||
CARD8 map[6];
|
||||
int lngMouseButtons, i;
|
||||
CARD8 *map;
|
||||
DevicePtr pDevice = (DevicePtr) pDeviceInt;
|
||||
|
||||
switch (iState)
|
||||
{
|
||||
case DEVICE_INIT:
|
||||
map[1] = 1;
|
||||
map[2] = 2;
|
||||
map[3] = 3;
|
||||
map[4] = 4;
|
||||
map[5] = 5;
|
||||
lngMouseButtons = GetSystemMetrics(SM_CMOUSEBUTTONS);
|
||||
ErrorF ("%d mouse buttons found\n", lngMouseButtons);
|
||||
map = malloc(sizeof(CARD8) * (lngMouseButtons + 1 + 2));
|
||||
|
||||
for (i=1; i <= lngMouseButtons + 2; i++)
|
||||
map[i] = i;
|
||||
InitPointerDeviceStruct (pDevice,
|
||||
map,
|
||||
5, /* Buttons 4 and 5 are mouse wheel events */
|
||||
lngMouseButtons + 2, /* Buttons 4 and 5 are mouse wheel events */
|
||||
miPointerGetMotionEvents,
|
||||
winMouseCtrl,
|
||||
miPointerGetMotionBufferSize ());
|
||||
free(map);
|
||||
|
||||
#if defined(XFree86Server) && defined(XINPUT)
|
||||
g_winMouseButtonMap = pDeviceInt->button->map;
|
||||
|
|
|
|||
Loading…
Reference in a new issue