Keyboard SCAN MODE

Alberto Poblacion alberto at proa.es
Fri Jun 21 22:40:43 AEST 1991


In article <91169.102311ACPS2924 at Ryerson.Ca> ACPS2924 at Ryerson.Ca writes:
>I'm using sco unix/386 and i'm trying to put the keyboard into something called
> raw mode. so i can read the keys in the dos fashion;
> .....
> Im trying to read the decode the keyboard , reading all the Fxx ALTxx CTRLxx
>and PGUP .... keys correctly.
> .....


       There is a way to put the keyboard in raw mode, documented in the
Development System Library Guide, in the "Event Manager" chapter:

      #include <sys/vtkd.h>
      
      fd=open("/dev/console",O_RDWR);
      ioctl(fd,KDSKBMODE,arg);

      arg is either K_RAW to enter raw mode, or K_XLATE for normal mode.

      This is probably lower-level than what you require, because the
keyboard will send scan codes instead of ascii when in K_RAW mode.
      On way of interpreting the scan codes is making use of a table
similar to the ones in /usr/lib/keyboard. You will have to write a program
that interprets the table and loads it into an array. Then you pass the
scan codes through the array in order to get the desired key codes. You
will have to pass only the "make" scancodes, and filter out the "break"
ones.



-- 
Alberto Poblacion
E-mail: alberto at proa.es



More information about the Comp.unix.xenix.sco mailing list