home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / pascal / swag / keyboard.swg / 0051_Keyboard Simulation.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-09-26  |  1.0 KB  |  27 lines

  1. (*
  2. From: MARC BIR
  3. Subj: KEYBOARD Simulation
  4.  
  5. {BW>Ok, here is my problem...I am trying to read a string from a
  6. file, poke it i the keyboard buffer, and then dump the contents of
  7. the buffer, so as to simulate that the user actually typed the
  8. string...This way the user doesnt have to type it all out..My
  9. program works fine, except if the string is more than characters, and
  10. if I try to clear the buffer after 16 characters, all I get the last
  11. few characters in the string..Can anyone please help?  I would real
  12. like to finish this dang project! :>  Thank you.}
  13.  
  14. {This should work, tested it out.  If it returns a false, you have to
  15. stop sending characters, until those that are in the buffer are used,
  16. doesn't matter what scancode is if you don't use, ditto for asciicode }
  17. *)
  18.  
  19. Function SimulateKey( AsciiCode, ScanCode : Byte ) : Boolean; Assembler
  20. Asm
  21.  Mov  AH, 05H
  22.  Mov  CH, ScanCode
  23.  Mov  CL, AsciiCode
  24.  Int  16H
  25.  XOR  AX, 1       { bios returns 1 = error, 0 = false, pascal opposite }
  26. End; { Returns false if buffer is full }
  27.