home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / os2apipm.zip / APIEXAM / PAD.ADB < prev    next >
Text File  |  1996-07-17  |  1KB  |  32 lines

  1. -- pad
  2. with os2; use os2;
  3. with os2.vio; use os2.vio;
  4. with os2.bse; use os2.bse;
  5. with os2.kbd; use os2.kbd;
  6. with text_io; use Text_io;
  7. with builtin; use builtin;
  8.  
  9. procedure pad  is  -- read key information
  10.  WAIT   :constant ushort :=0 ;   -- wait = 0, no wait =   1
  11.  HANDLE :constant ushort :=0 ;   -- kbd handle
  12.  ESC    :constant ushort :=27;   -- ASCII code [Esc] pad
  13.  keydata:aliased  KBDKEYINFO ;
  14.  begin
  15.   loop
  16.                                 -- read symbol
  17.     if KbdCharIn ( keydata'unchecked_access, WAIT, HANDLE) > 0
  18.     then put("KbdCharIn error"); goto fin; end if;
  19.                                 -- print out char data
  20.         new_line;
  21.         put_edit("Asii=",integer(keydata.chChar));
  22.         put_edit(" Scan=",integer(keydata.chScan));
  23.         put_edit(" Status=",integer(keydata.fbStatus));
  24.         put_edit(" Dshift=",integer(keydata.bNlsShift));
  25.         put_edit(" State =",integer(keydata.fsState));
  26.         put_edit(" Time (milliseconds) = ",integer(keydata.time));
  27.                                -- check for [Esc] key
  28.         exit when  keydata.chChar =  27 ;
  29.   end loop;
  30. <<fin>> null ;
  31. end pad;
  32.