Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request From: dcmartin@sun.com (David C. Martin) Newsgroups: comp.sys.sun Subject: determining keyboard type Keywords: Software Message-ID: <314@brazos.Rice.edu> Date: 21 Jul 89 17:20:43 GMT Sender: news@rice.edu Organization: Sun-Spots Lines: 49 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 8, Issue 79, message 14 of 15 I have a Sun4/110 with the new type 4 keyboard (which is actually okay, although there are always problems w/ keyboards other than the z19). Anyway, I wanted to determine what my keyboard type was and wrote the following quick program to "do the right thing" so I could remap the keys. However, I get SUN3 as my keyboard type (not SUN4). #include #include #include #include main(argc, argv) int argc; char** argv; { int fd, type; /* open descriptor on keyboard device */ if ((fd = open("/dev/kbd", O_RDONLY)) == -1) { perror("open"); exit(-1); } /* do ioctl on device */ if (ioctl(fd, KIOCTYPE, &type) == -1) { perror("ioctl"); exit(-1); } /* close descriptor */ close(fd); /* print type of keyboard */ switch(type) { case KB_KLUNK: printf("KLUNK\n"); break; case KB_VT100: printf("VT100\n"); break; case KB_ASCII: printf("ASCII\n"); break; case KB_SUN2: printf("SUN2\n"); break; case KB_SUN3: printf("SUN3\n"); break; case KB_SUN4: printf("SUN4\n"); break; } } What I would like to know is where the keyboard type is specified... I tried the eeprom program and it thinks the keyboard is type 0 (Micro Switch). Is the type specified in the kernel conf file, or is it determined at startup? Thanks in advance. dcm