Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!uunet!mcsun!goya!foro!proa!alberto From: alberto@proa.es (Alberto Poblacion) Newsgroups: comp.unix.xenix.sco Subject: Re: Keyboard SCAN MODE Message-ID: <1072@proa.es> Date: 21 Jun 91 12:40:43 GMT References: <91169.102311ACPS2924@Ryerson.Ca> Reply-To: alberto@proa.es (Alberto Poblacion) Organization: Compugraf,S.A. MADRID Spain Lines: 33 In article <91169.102311ACPS2924@Ryerson.Ca> ACPS2924@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 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@proa.es