Mail Archives: djgpp/1997/07/26/02:32:15
Erik Hansson writes:
>Could anyone tell me if I can use the Allegro keyboard-routines with a
>non-american keyboard layout? When I read a key and check the
>ASCII-value, it does not check out with what I'm used to (Swedish
>keyboard layout).
The keyboard hardware returns raw scancode numbers to my interrupt
handler, so there's no automatic way to support different keyboard
layouts. The conversion into ASCII characters is done with a couple of
lookup tables (found near the start of the file keyboard.c). Change
these tables, and all will be well...
As a more elegant solution, if you can send me suitable tables for a
Swedish keyboard and tell me how to detect when they should be used
(some DOS call, I suspect), I'll include them in the next release of
Allegro. 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...
--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
Beauty is a French phonetic corruption of a short cloth neck ornament.
- Raw text -