Message-ID: <33DB13BD.CCE@pobox.oleane.com> Date: Sun, 27 Jul 1997 11:24:13 +0200 From: Francois Charton Organization: CCMSA MIME-Version: 1.0 To: Shawn Hargreaves CC: djgpp AT delorie DOT com Subject: Re: Swedish keyboard layout in Allegro References: <33D69348 DOT AE34B6FC AT canit DOT se> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Shawn Hargreaves wrote: > > Or even better, if anyone knows how to access the scancode- > ascii mapping being used by DOS itself, I'd really like to know about > it! I suspect the gory details will differ between different OS > versions, but it would be nice if it could be done... > Foreign keyboards are handled through the KEYB.COM program, which comes with the DOS "package". It is called in your autoexec.bat, by loading something like this (for France, obviously) C:\CPQDOS\KEYB FR, 437, C:\CPQDOS\KEYBOARD.SYS I suppose its role is to redirect interrupt 09h, so that it links the right ascii codes to the right scan codes. A way to generate such a table would be to 1. execute KEYB.COM with the desired country parameter (you would not need to do this in a runtime environement, has AUTOEXEC.BAT has already done it for you) 2. simulate keypresses on all the keyboard keys (can you call int09h?, if all fails, then you would have to do it "by hand", once and for all) and use int 1600h to read the corresponding ASCII codes. 3. Build a keyboard table, and use it in allegro. If there is a way to automatically simulate keypresses, and test the current scancodes to ascii relations, this could be done in the very beginning of allegro "install keyboard" function, to build the keyboard mapping tables on the fly. Else, you will have to do it once for all the possible keyboards, try all the keys, and incorporate the result into a set of table. At runtime, you would only need to call the "detect country" function sent to the list/NG yesterday, and use the corresponding table. Francois