home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 41,527 of 42,547   
   Kerr Mudd-John to dgdavis@blackhole.nyx.net   
   Re: MS-DOS utility to distinguish betwee   
   03 Dec 16 19:50:17   
   
   XPost: alt.lang.asm   
   From: admin@127.0.0.1   
      
   On Sun, 27 Nov 2016 05:20:37 -0000, Donald G. Davis   
    wrote:   
      
   > 	I'd like to learn whether someone knows of a MS-DOS utility that can   
   > tell whether a "standard" (older) keyboard or a 101-key keyboard is   
   > attached to the computer, and report accordingly, preferably with a   
   > suitable exit code for input to a batch file.   
   >   
   > 							--Donald Davis   
      
   I've found an old Delphi forum post:   
      
   function status:word;   
              inline(   
              $B8/$00/$12/      {MOV AX,1200h}   
              $CD/$16           {INT 16h }   
              );   
      
   {$ifdef msdos}   
     const seg0040=$40;   
     {$endif}   
      
   begin   
       tmp:=mem[Seg0040:$17];   
       extended_kbd:=false;   
       if lo(status)=tmp then begin   
          mem[Seg0040:$17]:=tmp xor 7;   
          tmp2:=status;   
          extended_kbd:=(tmp2<>$1200) and (lo(tmp2)=tmp xor 7);   
          mem[Seg0040:$17]:=tmp;   
       End;   
   end.   
      
   It's mostly asm. Toggles a shift key then uses an extended keyboard call   
   to see if it's changed.   
   Should be easily rewritten in asm or ascii asm for use in batch.   
      
   (xposted to asm & batch groups)   
   --   
   Bah, and indeed, Humbug   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca