diff options
author | Jeremy C. Reed <reed@glacier.reedmedia.net> | 2006-11-13 20:32:26 -0600 |
---|---|---|
committer | Jeremy C. Reed <reed@glacier.reedmedia.net> | 2006-11-13 20:32:26 -0600 |
commit | a724b7f1302ba7a59f140b521f13d2ddf0fcf9bf (patch) | |
tree | 29351ae423e57d20f3c54623667b1a5d4ea7c8e3 /hw/kdrive/linux/linux.c | |
parent | 6facd958c2e7098cb68eac2810a88b8cd40f19c0 (diff) | |
parent | f80a8ae6e6820378ea70ac0849cee8bf3055e0e8 (diff) |
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver
Diffstat (limited to 'hw/kdrive/linux/linux.c')
-rw-r--r-- | hw/kdrive/linux/linux.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/hw/kdrive/linux/linux.c b/hw/kdrive/linux/linux.c index be11ec539..c1fe185bd 100644 --- a/hw/kdrive/linux/linux.c +++ b/hw/kdrive/linux/linux.c @@ -373,26 +373,6 @@ LinuxEnable (void) enabled = TRUE; } -static Bool -LinuxSpecialKey (KeySym sym) -{ - struct vt_stat vts; - int con; - - if (XK_F1 <= sym && sym <= XK_F12) - { - con = sym - XK_F1 + 1; - memset (&vts, '\0', sizeof (vts)); /* valgrind */ - ioctl (LinuxConsoleFd, VT_GETSTATE, &vts); - if (con != vts.v_active && (vts.v_state & (1 << con))) - { - ioctl (LinuxConsoleFd, VT_ACTIVATE, con); - return TRUE; - } - } - return FALSE; -} - static void LinuxDisable (void) { @@ -456,6 +436,7 @@ LinuxFini (void) } } close(LinuxConsoleFd); /* make the vt-manager happy */ + LinuxConsoleFd = -1; fd = open ("/dev/tty0", O_RDWR|O_NDELAY, 0); if (fd >= 0) { @@ -468,13 +449,32 @@ LinuxFini (void) return; } +void +KdOsAddInputDrivers () +{ + KdAddPointerDriver(&LinuxMouseDriver); + KdAddPointerDriver(&MsMouseDriver); + KdAddPointerDriver(&Ps2MouseDriver); +#ifdef TSLIB + KdAddPointerDriver(&TsDriver); +#endif + KdAddKeyboardDriver(&LinuxKeyboardDriver); +} + +static void +LinuxBell(int volume, int pitch, int duration) +{ + if (volume && pitch) + ioctl(LinuxConsoleFd, KDMKTONE, ((1193190 / pitch) & 0xffff) | + (((unsigned long)duration * volume / 50) << 16)); +} + KdOsFuncs LinuxFuncs = { - LinuxInit, - LinuxEnable, - LinuxSpecialKey, - LinuxDisable, - LinuxFini, - 0 + .Init = LinuxInit, + .Enable = LinuxEnable, + .Disable = LinuxDisable, + .Fini = LinuxFini, + .Bell = LinuxBell, }; void |