static Status MouseEnable(KdPointerInfo * pi) { ((EphyrPointerPrivate *) pi->driverPrivate)->enabled = TRUE; SetNotifyFd(hostx_get_fd(), ephyrXcbNotify, X_NOTIFY_READ, NULL); return Success; }
/* See Porting Layer Definition - p. 17 */ void InitInput(int argc, char *argv[]) { #if CYGDEBUG winDebug("InitInput\n"); #endif #ifdef XWIN_CLIPBOARD /* * Wrap some functions at every generation of the server. */ if (InitialVector[2] != winProcEstablishConnection) { winProcEstablishConnectionOrig = InitialVector[2]; InitialVector[2] = winProcEstablishConnection; } #endif if (AllocDevicePair(serverClient, "Windows", &g_pwinPointer, &g_pwinKeyboard, winMouseProc, winKeybdProc, FALSE) != Success) FatalError("InitInput - Failed to allocate slave devices.\n"); mieqInit(); /* Initialize the mode key states */ winInitializeModeKeyStates(); #ifdef HAS_DEVWINDOWS /* Only open the windows message queue device once */ if (g_fdMessageQueue == WIN_FD_INVALID) { /* Open a file descriptor for the Windows message queue */ g_fdMessageQueue = open(WIN_MSG_QUEUE_FNAME, O_RDONLY); if (g_fdMessageQueue == -1) { FatalError("InitInput - Failed opening %s\n", WIN_MSG_QUEUE_FNAME); } /* Add the message queue as a device to wait for in WaitForSomething */ SetNotifyFd(g_fdMessageQueue, xwinDevWindowsHandlerNotify, X_NOTIFY_READ, NULL); } #endif #if CYGDEBUG winDebug("InitInput - returning\n"); #endif }
static void LinuxEnable(void) { if (enabled) return; if (kdSwitchPending) { kdSwitchPending = FALSE; ioctl(LinuxConsoleFd, VT_RELDISP, VT_ACKACQ); } /* * Open the APM driver */ LinuxApmFd = open("/dev/apm_bios", 2); if (LinuxApmFd < 0 && errno == ENOENT) LinuxApmFd = open("/dev/misc/apm_bios", 2); if (LinuxApmFd >= 0) { LinuxApmRunning = TRUE; fcntl(LinuxApmFd, F_SETFL, fcntl(LinuxApmFd, F_GETFL) | NOBLOCK); SetNotifyFd(LinuxApmFd, LinuxApmNotify, X_NOTIFY_READ, NULL); } /* * now get the VT */ LinuxSetSwitchMode(VT_AUTO); if (ioctl(LinuxConsoleFd, VT_ACTIVATE, vtno) != 0) { FatalError("LinuxInit: VT_ACTIVATE failed\n"); } if (ioctl(LinuxConsoleFd, VT_WAITACTIVE, vtno) != 0) { FatalError("LinuxInit: VT_WAITACTIVE failed\n"); } LinuxSetSwitchMode(VT_PROCESS); if (ioctl(LinuxConsoleFd, KDSETMODE, KD_GRAPHICS) < 0) { FatalError("LinuxInit: KDSETMODE KD_GRAPHICS failed\n"); } enabled = TRUE; }