home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sys.sun.misc:5821 comp.sys.sun.hardware:6197
- Newsgroups: comp.sys.sun.misc,comp.sys.sun.hardware
- Path: sparky!uunet!spool.mu.edu!yale.edu!yale!gumby!destroyer!cs.ubc.ca!alberta!cpsc.ucalgary.ca!aycock
- From: aycock@pogo.cuc.ab.ca (John Aycock)
- Subject: Re: num-lock LED stays on
- In-Reply-To: mills@ccu.umanitoba.ca's message of Fri, 11 Dec 1992 03:37:38 GMT
- Message-ID: <AYCOCK.92Dec11205837@pogo.pogo.cuc.ab.ca>
- Sender: news@cpsc.ucalgary.ca (News Manager)
- Organization: UUCP, University of Calgary
- References: <ByqsEq.L0K@jabba.ess.harris.com> <1fo8liINNdvt@moe.ksu.ksu.edu>
- <Bz2sqr.4Hr@ccu.umanitoba.ca>
- Date: Sat, 12 Dec 1992 03:58:37 GMT
- Lines: 37
-
- This is what I use to fix the locked keyboards with the numlock light on.
- It's worked every time for me sofar. (WARNING: watch out if you're using
- it remotely! Sometimes the user the keyboard locked on isn't logged out
- when it becomes unstuck.) Standard disclaimer applies on the code. Our
- guess is that there's a race condition when the X server exits that causes
- this, but we haven't been able to nail it down. If anyone has had more
- luck on this I'd like to hear from you.
-
- BTW, you don't need to be root to run this.
- :ja
-
- --
- #include <stdio.h>
- #include <fcntl.h>
-
- #include <sys/types.h>
- #include <sundev/kbio.h>
- #include <sundev/kbd.h>
-
- main()
- {
- int cmd = 1;
- int fd = open("/dev/kbd", O_RDWR);
- if (fd < 0) {
- perror("open");
- exit(1);
- }
- if (ioctl(fd, KIOCSDIRECT, &cmd) < 0) {
- perror("ioctl(KIOCSDIRECT)");
- exit(1);
- }
- exit(0);
- }
- --
-
- //\|_||\| John D. Aycock aycock@cpsc.ucalgary.ca
- \/ \/| || | (403) 285-8727 aycock@pogo.cuc.ab.ca
-