Mail Archives: djgpp/1997/07/26/22:48:33
Gisle Vanem writes:
>Here is a function to return the country-code. Sweden is 46...you'll
>find them in your telephone directory:
This could be useful: thanks!
>>> 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!
>
>Check out INT 15/4F which translates scancodes.
Unfortunately I don't think that is any use for. According to the
interrupt list:
Notes: called by INT 09 handler to translate scan codes; the INT 09
code does not examine the scan code it reads from the keyboard until
after this function returns. This permits software to rearrange the
keyboard; for example, swapping the CapsLock and Control keys, or
turning the right Shift key into Enter.
To me this sounds like it's a lower level hook for use by keyboard
extenders, which takes place _before_ the BIOS does the scancode to
ascii conversion. I wrote a little test program, and on my machine
(Win95 DOS box running 4DOS) it generates a 1->1 mapping regardless of
whether I select a UK or US keyboard layout. It would be useful if you
could try this on a Swedish system, but I have a nasty feeling that it
won't output anything useful...
#include <stdio.h>
#include <dpmi.h>
int main()
{
__dpmi_regs r;
int i;
for (i=0; i<128; i++) {
r.x.ax = 0x4F00 + i;
__dpmi_int(0x15, &r);
printf("%d -> %d\n", i, r.x.ax&0xFF);
}
return 0;
}
--
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 -