static int vfbMouseProc(DeviceIntPtr pDevice, int onoff) { BYTE map[4]; DevicePtr pDev = (DevicePtr)pDevice; switch (onoff) { case DEVICE_INIT: map[1] = 1; map[2] = 2; map[3] = 3; InitPointerDeviceStruct(pDev, map, 3, miPointerGetMotionEvents, (PtrCtrlProcPtr)NoopDDA, miPointerGetMotionBufferSize()); break; case DEVICE_ON: pDev->on = TRUE; break; case DEVICE_OFF: pDev->on = FALSE; break; case DEVICE_CLOSE: break; } return Success; }
int xnestPointerProc(DeviceIntPtr pDev, int onoff) { CARD8 map[MAXBUTTONS]; int nmap; int i; switch (onoff) { case DEVICE_INIT: nmap = XGetPointerMapping(xnestDisplay, map, MAXBUTTONS); for (i = 0; i <= nmap; i++) map[i] = i; /* buttons are already mapped */ InitPointerDeviceStruct(&pDev->public, map, nmap, miPointerGetMotionEvents, xnestChangePointerControl, miPointerGetMotionBufferSize()); break; case DEVICE_ON: xnestEventMask |= XNEST_POINTER_EVENT_MASK; for (i = 0; i < xnestNumScreens; i++) XSelectInput(xnestDisplay, xnestDefaultWindows[i], xnestEventMask); break; case DEVICE_OFF: xnestEventMask &= ~XNEST_POINTER_EVENT_MASK; for (i = 0; i < xnestNumScreens; i++) XSelectInput(xnestDisplay, xnestDefaultWindows[i], xnestEventMask); break; case DEVICE_CLOSE: break; } return Success; }
int winMouseProc (DeviceIntPtr pDeviceInt, int iState) { CARD8 map[6]; DevicePtr pDevice = (DevicePtr) pDeviceInt; switch (iState) { case DEVICE_INIT: map[1] = 1; map[2] = 2; map[3] = 3; map[4] = 4; map[5] = 5; InitPointerDeviceStruct (pDevice, map, 5, /* Buttons 4 and 5 are mouse wheel events */ miPointerGetMotionEvents, winMouseCtrl, miPointerGetMotionBufferSize ()); break; case DEVICE_ON: pDevice->on = TRUE; break; case DEVICE_CLOSE: case DEVICE_OFF: pDevice->on = FALSE; break; } return Success; }
static int PointerProc( DevicePtr pPtr, int what, int argc, char *argv[]) { #define NUM_BUTTONS 1 CARD8 map[NUM_BUTTONS]; switch(what) { case DEVICE_INIT: { map[0] = 0; InitPointerDeviceStruct(pPtr, map, NUM_BUTTONS, miPointerGetMotionEvents, (PtrCtrlProcPtr)_XpVoidNoop, miPointerGetMotionBufferSize()); break; } case DEVICE_ON: break; case DEVICE_OFF: break; case DEVICE_CLOSE: break; } return Success; }
static int KdMouseProc(DeviceIntPtr pDevice, int onoff) { BYTE map[KD_MAX_BUTTON]; DevicePtr pDev = (DevicePtr)pDevice; int i; if (!pDev) return BadImplementation; switch (onoff) { case DEVICE_INIT: for (i = 1; i <= kdMouseButtonCount; i++) map[i] = i; InitPointerDeviceStruct(pDev, map, kdMouseButtonCount, miPointerGetMotionEvents, (PtrCtrlProcPtr)NoopDDA, miPointerGetMotionBufferSize()); break; case DEVICE_ON: pDev->on = TRUE; pKdPointer = pDevice; for (i = 0; i < kdNMouseFuncs; i++) (*kdMouseFuncs[i]->Init)(); break; case DEVICE_OFF: case DEVICE_CLOSE: if (pDev->on) { pDev->on = FALSE; pKdPointer = 0; for (i = 0; i < kdNMouseFuncs; i++) (*kdMouseFuncs[i]->Fini) (); } break; } return Success; }