Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!ames!ucbcad!ucbvax!decvax!decwrl!sun!imagen!atari!daisy!turner From: turner@daisy.UUCP (D'arc Angel) Newsgroups: comp.windows.x Subject: Re: fixing Sun keyboard after X failure Message-ID: <466@daisy.UUCP> Date: Fri, 7-Aug-87 21:37:25 EDT Article-I.D.: daisy.466 Posted: Fri Aug 7 21:37:25 1987 Date-Received: Sun, 9-Aug-87 11:30:31 EDT References: <9997@duke.cs.duke.edu> Organization: The Houses of the Holy Lines: 69 > Posted: Tue Aug 4 09:24:05 1987 > > We're considering going to X instead of SunView, and I've > run into a problem: if the X server dies unexpectly, the > associated keyboard is left in some strange state that renders > it unusable. This is especially bothersome when it happens on the > server. I have tried the fixKbd program that was recently posted > to this group, but it did not appear to have any affect. Does > anyone know how I can reset the keyboard short of rebooting? > > Ned Danieley (ndd@sunbar.mc.duke.edu) > Basic Arrhythmia Laboratory > Duke University Medical Center > Durham, NC 27710 > (919) 684-6807 or 684-6942 here's a program passed on to me from a kind soul as sequent.. ----cut here--------cut here--------cut here--------cut here---- #!/bin/csh -f # runs X server and ensures keyboard doesn't hang set oldkey = `kreset` set server = X cd ~ $server >& ,server kreset $oldkey ---and here---and here---and here---and here---and here---and here #include #include #include #include #include #include main (argc, argv) int argc; char *argv[]; { int oldtrans; int newtrans; int kfd; kfd = open ("/dev/kbd", O_RDWR); if (kfd < 0) { perror ("open"); exit (-1); } if (ioctl (kfd, KIOCGTRANS, &oldtrans) < 0) { perror ("KIOCGTRANS"); exit (-1); } printf ("%d\n", oldtrans); if (argc > 1) { newtrans = atoi (argv[1]); if (ioctl (kfd, KIOCTRANS, &newtrans) < 0) { perror ("KIOCTRANS"); exit (-1); } } return (0); } -- C'est la vie, C'est la guerre, C'est la pomme de terre {cbosgd,fortune,hplabs,seismo!ihnp4,ucbvax}!nsc!daisy!turner Jim Turner Daisy Systems, 700 E. Middlefield Rd, P.O. Box 7006, Mountain View CA 94039-7006. (415)960-0123