delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/26/13:24:07

Date: Sat, 26 Jul 1997 19:23:58 +0200 (MET DST)
From: Gisle Vanem <giva AT bryggen DOT bgnett DOT no>
To: djgpp AT delorie DOT com
Subject: Re: Swedish keyboard layout in Allegro
Message-ID: <Pine.UW2.3.95.970726192325.5247A-100000@bryggen.bgnett.no>
MIME-Version: 1.0

 
Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk> said:
 
>> 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),
 
Here is a function to return the country-code. Sweden is 46...you'll
find them in your telephone directory:
 
char country_info[35];
 
int GetCountryCode (void)
{
  if (_osmajor >= 3)
  {
    __dpmi_regs reg;
    reg.d.edx = 0;
    reg.x.ds  = __tb / 16;
    reg.d.eax = 0x3800;
    __dpmi_int (0x21,&reg);
    if (reg.x.flags & 1)
      return 0;
    dosmemget (__tb,sizeof(country_info),&country_info);
    return reg.x.bx;
  }
  return -1;
}
 
>> 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.
 
Gisle V.
 


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019