home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff339.lzh / PCQ / Runtime.lzh / Runtime / Extras / ConsoleUtils.p < prev    next >
Text File  |  1989-10-21  |  706b  |  32 lines

  1. External;
  2.  
  3. {
  4.     These routines just open and close the Console device without
  5. attaching it to any window.  They update ConsoleBase, and are thus required
  6. for RawKeyConvert and DeadKeyConvert.
  7. }
  8.  
  9. {$I "Include/ExecIO.i"}
  10. {$I "Include/InputEvent.i"}
  11.  
  12. var
  13.     ConsoleBase : Address;    { external references }
  14.     ConsoleRequest : IOStdReq;
  15.  
  16. Procedure OpenConsoleDevice;
  17. {
  18.     This procedure initializes ConsoleDevice, which is required for
  19.     CDInputHandler and RawKeyConvert.
  20. }
  21. var
  22.     Error : Integer;
  23. begin
  24.     Error := OpenDevice("console.device", -1, Adr(ConsoleRequest), 0);
  25.     ConsoleBase := ConsoleRequest.ioReq.ioDevice;
  26. end;
  27.  
  28. Procedure CloseConsoleDevice;
  29. begin
  30.     CloseDevice(Adr(ConsoleRequest));
  31. end;
  32.