_X_EXPORT void xf86OSRingBell(int loudness, int pitch, int duration) { #ifdef WSCONS_SUPPORT struct wskbd_bell_data wsb; #endif if (loudness && pitch) { #ifdef PCCONS_SUPPORT int data[2]; #endif switch (xf86Info.consType) { #ifdef PCCONS_SUPPORT case PCCONS: data[0] = pitch; data[1] = (duration * loudness) / 50; ioctl(xf86Info.consoleFd, CONSOLE_X_BELL, data); break; #endif #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) case SYSCONS: case PCVT: ioctl(xf86Info.consoleFd, KDMKTONE, ((1193190 / pitch) & 0xffff) | (((unsigned long)duration*loudness/50)<<16)); break; #endif #if defined (WSCONS_SUPPORT) case WSCONS: wsb.which = WSKBD_BELL_DOALL; wsb.pitch = pitch; wsb.period = duration; wsb.volume = loudness; ioctl(KBD_FD(xf86Info), WSKBDIO_COMPLEXBELL, &wsb); break; #endif } } }
void xf86SetKbdLeds(int leds) { switch (xf86Info.consType) { case PCCONS: break; #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) case SYSCONS: case PCVT: ioctl(xf86Info.consoleFd, KDSETLED, leds); break; #endif #if defined(WSCONS_SUPPORT) case WSCONS: ioctl(KBD_FD(xf86Info), WSKBDIO_SETLEDS, &leds); break; #endif } }
int xf86GetKbdLeds() { int leds = 0; switch (xf86Info.consType) { case PCCONS: break; #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) case SYSCONS: case PCVT: ioctl(xf86Info.consoleFd, KDGETLED, &leds); break; #endif #if defined(WSCONS_SUPPORT) case WSCONS: ioctl(KBD_FD(xf86Info), WSKBDIO_GETLEDS, &leds); break; #endif } return(leds); }