home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / pascal / visionix / vpointu.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-12-28  |  18.3 KB  |  1,185 lines

  1. {
  2.  ════════════════════════════════════════════════════════════════════════════
  3.  
  4.  Visionix Pointer Device Unit (VPOINT)
  5.    Version 0.1
  6.  Copyright 1991,92,93 Visionix
  7.  ALL RIGHTS RESERVED
  8.  
  9.  ────────────────────────────────────────────────────────────────────────────
  10.  
  11.  Revision history in reverse chronological order:
  12.  
  13.  Initials  Date      Comment
  14.  ────────  ────────  ────────────────────────────────────────────────────────
  15.  
  16.  jrt       11/23/93  Filled in the code--calls INTR $33 for everything
  17.                      but OS/2; uses VMOU when compiled for OS/2.
  18.  
  19.  jrt       09/01/92  First logged revision.
  20.  
  21.  ────────────────────────────────────────────────────────────────────────────
  22.  
  23.  C A V E A T S    /    K N O W N   B U G S
  24.  
  25.  Mouse buttons "stick" when running os/2
  26.  
  27.  Mouse cursor sometimes dissapears when running os/2--probably a
  28.  problem with the MyOffCount logic.
  29.  
  30. }
  31.  
  32. (*-
  33.  
  34. [TEXT]
  35.  
  36. <Overview>
  37.  
  38. VPointu implements a comprehensive, easy to use "mouse" function library
  39. that works under DOS, protected mode, and OS/2.
  40.  
  41. This overview will be enhanced in the next BETA release.
  42.  
  43. <Interface>
  44.  
  45.  
  46. -*)
  47.  
  48.  
  49. Unit VPointU;
  50.  
  51. Interface
  52.  
  53. Uses
  54.  
  55.   DOS,
  56. {$IFDEF OS2}
  57.   VMouI,
  58. {$ENDIF}
  59.   VTypesu;
  60.  
  61. Const
  62.  
  63.   mbLEFT        = 1;
  64.   mbCENTER      = 8;
  65.   mbRIGHT       = 2;
  66.   mbLEFTRIGHT   = 1+2;
  67.   mbLEFTCENTER  = 1+8;
  68.   mbRIGHTCENTER = 2+8;
  69.   mbALL         = 1+2+8;
  70.  
  71.  
  72.  
  73.   cmfReadCells  = 0;
  74.   cmfReadPixels = 1;
  75.  
  76. Type
  77.  
  78.   TMouseCaps = RECORD
  79.  
  80.     NumButtons : BYTE;
  81.  
  82.   END;
  83.  
  84.   PMouseCaps = ^TMouseCaps;
  85.  
  86. {────────────────────────────────────────────────────────────────────────────}
  87.  
  88. Procedure VMouseGetCaps(              Caps        : PMouseCaps );
  89.  
  90. Function  VMouseInstalled : BOOLEAN;
  91.  
  92. Function  VMouseOpen(                 Flags       : WORD;
  93.                                       MouType     : BYTE       ):WORD;
  94.  
  95. Procedure VMouseClose;
  96.  
  97. Procedure VMouseOn;
  98.  
  99. Procedure VMouseOff;
  100.  
  101. Procedure VMouseTypeSet(          PointerID   : BYTE       );
  102.  
  103. Procedure VMouseVertLimitSet(     MaxRow      : WORD       );
  104.  
  105. Procedure VMouseRead(             Var Button      : BYTE;
  106.                                   Var X           : WORD;
  107.                                   Var Y           : WORD       );
  108.  
  109.  
  110. Function  VMouseReadButtons : BYTE;
  111.  
  112. Function  VMouseReadX : WORD;
  113.  
  114. Function  VMouseReadY : WORD;
  115.  
  116. Procedure VMouseWaitRelease(    Buttons     : BYTE       );
  117.  
  118. Procedure VMouseWaitPress(      Buttons     : BYTE       );
  119.  
  120.  
  121.  
  122.  
  123. (*
  124. Procedure VMouseProcNew(                BPressed    : BYTE;
  125.                                       BReleased   : BYTE;
  126.                                       X1          : WORD;
  127.                                       Y1          : WORD;
  128.                                       X2          : WORD;
  129.                                       Y2          : WORD;
  130.                                       Proc        : POINTER;
  131.                                       Id          : POINTER;
  132.                                       Name        : TProcName;
  133.                                   Var Err         : WORD       );
  134.  
  135. Procedure VMouseProcOn(                 Name        : TProcName  );
  136.  
  137. Procedure VMouseProcOff(                Name        : TProcName  );
  138.  
  139. Procedure VMouseProcDispose(            Name        : TProcName  );
  140.  
  141. Procedure VMouseSubmitButtonKey(        Button      : BYTE;
  142.                                       Key1        : CHAR;
  143.                                       Key2        : CHAR       );
  144.  
  145. *)
  146.  
  147.  
  148. {────────────────────────────────────────────────────────────────────────────}
  149.  
  150. Implementation
  151.  
  152. Var
  153.  
  154.   MyHandle       : WORD;
  155.   MyMouseType    : WORD;
  156.   MyMouseFlags   : WORD;
  157.  
  158. {$IFDEF OS2}
  159.  
  160.   MyOffCount     : LONGINT;
  161.  
  162.   MyLastMEI      : TMouEventInfo;
  163.  
  164.   {---------------------------------------}
  165.  
  166.   Function GetNumQMEI : WORD;
  167.  
  168.   Var
  169.     MQI : TMouQueInfo;
  170.  
  171.   BEGIN
  172.  
  173.     MouGetNumQueEl( @MQI, MyHandle );
  174.  
  175.     GetNumQMEI := MQI.Events;
  176.  
  177.   END;
  178.  
  179.   {---------------------------------------}
  180.  
  181.   Function GetMEI : BOOLEAN;
  182.  
  183.   Var
  184.  
  185.     F       : WORD;
  186.     NumQMEI : WORD;
  187.  
  188.   BEGIN
  189.  
  190.     { get num of mouse events in the queue }
  191.  
  192.     NumQMEI := GetNumQMEI;
  193.  
  194.     { are their any mouse events in the queue? }
  195.  
  196.     If NumQMEI>0 Then
  197.     BEGIN
  198.  
  199.       { yep, read the next mouse event }
  200.  
  201.       F := 1;
  202.       MouReadEventQue( @MyLastMEI, F, MyHandle );
  203.  
  204.       { are their still some in the queue? }
  205.  
  206.       GetMEI := (NumQMEI) > 1;
  207.  
  208.     END
  209.     ELSE
  210.       GetMEI := FALSE;
  211.  
  212.   END;
  213.  
  214.   {---------------------------------------}
  215.  
  216.   Function GetCurrentLastMEI : BOOLEAN;
  217.  
  218.   Var
  219.  
  220.     F       : WORD;
  221.     Loop    : WORD;
  222.     NumQMEI : WORD;
  223.  
  224.   BEGIN
  225.  
  226.     NumQMEI := GetNumQMEI;
  227.     F       := 0;
  228.  
  229.     { get all the currently enqueued mouse events }
  230.  
  231.     While NumQMEI>0 Do
  232.     BEGIN
  233.       MouReadEventQue( @MyLastMEI, F, MyHandle );
  234.       Dec( NumQMEI );
  235.     END;
  236.  
  237.     { did any knew mouse events show up? }
  238.  
  239.     GetCurrentLastMEI := (GetNumQMEI<>0);
  240.  
  241.   END;
  242.  
  243.   {---------------------------------------}
  244.  
  245.   Function ButtonTranslate( MEI : PMouEventInfo ) : BYTE;
  246.  
  247.   BEGIN
  248.  
  249.     Case MEI^.FS of
  250.  
  251.        $01 : ButtonTranslate := 0;               { motion }
  252.  
  253.        $02 : ButtonTranslate := mbLEFT;          { button1+motion    }
  254.        $04 : ButtonTranslate := mbLEFT;          { button1           }
  255.  
  256.        $08 : ButtonTranslate := mbRIGHT;         { button2+motion    }
  257.        $10 : ButtonTranslate := mbRIGHT;         { button2           }
  258.  
  259.        $14 : ButtonTranslate := mbLEFT+mbRIGHT;  { both buttons      }
  260.        $0A : ButtonTranslate := mbLEFT+mbRIGHT;  { both + motion     }
  261.  
  262.     ELSE
  263.       ButtonTranslate := 0;
  264.     END;
  265.  
  266.   END;
  267.  
  268.  
  269.   {---------------------------------------}
  270.  
  271. {$ENDIF}
  272.  
  273. {────────────────────────────────────────────────────────────────────────────}
  274.  
  275.  
  276. (*-
  277.  
  278. [FUNCTION]
  279.  
  280. Procedure VMouseGetCaps(              Caps        : PMouseCaps );
  281.  
  282. [PARAMETERS]
  283.  
  284. Caps        pointer to a mouse capabilities structure
  285.  
  286. [RETURNS]
  287.  
  288. caps        filled in
  289.  
  290. [DESCRIPTION]
  291.  
  292. This function gets the mouse capabilities structure for the current
  293. environment.  IT IS NOT YET IMPLEMENTED.
  294.  
  295. [SEE-ALSO]
  296.  
  297. [EXAMPLE]
  298.  
  299.  
  300.  
  301. -*)
  302.  
  303. Procedure VMouseGetCaps(              Caps        : PMouseCaps );
  304.  
  305. BEGIN
  306. END;
  307.  
  308. {────────────────────────────────────────────────────────────────────────────}
  309.  
  310. (*-
  311.  
  312. [FUNCTION]
  313.  
  314. Function  VMouseInstalled : BOOLEAN;
  315.  
  316. [PARAMETERS]
  317.  
  318. None.
  319.  
  320. [RETURNS]
  321.  
  322. TRUE if a mouse and appropriate mouse driver are installed,
  323. FALSE it they are not.
  324.  
  325. [DESCRIPTION]
  326.  
  327. This function determines if a mouse and its appropriate mouse driver
  328. are installed.  If so, this function returns TRUE and the other
  329. VMousexxx functions can be used (after VMouseOpen is called).
  330.  
  331. This function returns FALSE if either a mouse or mouse driver is
  332. not present.
  333.  
  334. [SEE-ALSO]
  335.  
  336. [EXAMPLE]
  337.  
  338.   IF VMouseInstalled Then
  339.     WriteLN('A Mouse and driver are present.')
  340.   Else
  341.     WriteLN('A Mouse and/or driver are not present.');
  342.  
  343.  
  344. -*)
  345.  
  346.  
  347. Function  VMouseInstalled : BOOLEAN;
  348.  
  349. {$IFNDEF OS2}
  350.  
  351. Var
  352.  
  353.   R : REGISTERS;
  354.  
  355. BEGIN
  356.  
  357.   R.AX  := $0;
  358.   R.ES  := $0;
  359.   R.DS  := $0;
  360.  
  361.   Intr( $33, R );
  362.  
  363.   VMouseInstalled := (R.AX=$FFFF);
  364.  
  365. END;
  366.  
  367. {$ELSE}
  368.  
  369. Var
  370.  
  371.   MHandle : WORD;
  372.  
  373. BEGIN
  374.  
  375.   If MouOpen( NIL, MHandle )=0 Then
  376.   BEGIN
  377.     MouClose( MHandle );
  378.     VMouseInstalled := TRUE;
  379.   END
  380.   ELSE
  381.     VMouseInstalled := FALSE;
  382.  
  383. END;
  384.  
  385. {$ENDIF} { not os2 / else }
  386.  
  387. {────────────────────────────────────────────────────────────────────────────}
  388.  
  389.  
  390. (*-
  391.  
  392. [FUNCTION]
  393.  
  394. Function  VMouseOpen(             Flags       : WORD;
  395.                                   MouType     : BYTE       ):WORD;
  396.  
  397. [PARAMETERS]
  398.  
  399. flags           mouse open flags (currently unused)
  400. moutype         mouse pointer type (currently unused)
  401.  
  402. [RETURNS]
  403.  
  404. 0 if the open was successfull,
  405. non 0 if it failed.
  406.  
  407. [DESCRIPTION]
  408.  
  409. This function opens and initializes the mouse.  After calling this
  410. function, the other VMousexxx functions can be used.
  411.  
  412. [SEE-ALSO]
  413.  
  414. [EXAMPLE]
  415.  
  416.   IF VMouseInstalled Then
  417.     WriteLN('A Mouse and driver are present.')
  418.   Else
  419.     WriteLN('A Mouse and/or driver are not present.');
  420.  
  421.  
  422. -*)
  423.  
  424. Function  VMouseOpen(             Flags       : WORD;
  425.                                   MouType     : BYTE       ):WORD;
  426.  
  427. {$IFNDEF OS2}
  428.  
  429. Var
  430.  
  431.   R : REGISTERS;
  432.  
  433. BEGIN
  434.  
  435.   MyMouseType := MouType;
  436.  
  437.   R.AX  := $0;
  438.   R.ES  := $0;
  439.   R.DS  := $0;
  440.  
  441.   Intr( $33, R );
  442.  
  443.   If R.AX=$FFFF Then
  444.     VMouseOpen := 0
  445.   ELSE
  446.     VMouseOpen := $FFFF;
  447.  
  448. END;
  449.  
  450. {$ELSE}
  451.  
  452. Var
  453.  
  454.   F : WORD;
  455.  
  456. BEGIN
  457.  
  458.   MyMouseType := MouType;
  459.  
  460.   VMouseOpen := MouOpen( NIL, MyHandle );
  461.  
  462.   { prime the LastMEI record }
  463.  
  464.   F := 0;
  465.  
  466.   MouReadEventQue( @MyLastMEI, F, MyHandle );
  467.  
  468.   MyOffCount := 1;
  469.  
  470. END;
  471.  
  472. {$ENDIF} { notdef os2 / else }
  473.  
  474. {────────────────────────────────────────────────────────────────────────────}
  475.  
  476.  
  477. (*-
  478.  
  479. [FUNCTION]
  480.  
  481. Procedure VMouseClose;
  482.  
  483.  
  484. [PARAMETERS]
  485.  
  486. None.
  487.  
  488. [RETURNS]
  489.  
  490. Nothing.
  491.  
  492. [DESCRIPTION]
  493.  
  494. This function closes and deinitializes the mouse.  This function should
  495. be called when you are finished with the mouse.
  496.  
  497. [SEE-ALSO]
  498.  
  499. [EXAMPLE]
  500.  
  501. -*)
  502.  
  503.  
  504. Procedure VMouseClose;
  505.  
  506. {$IFNDEF OS2}
  507.  
  508. Var
  509.  
  510.   R : REGISTERS;
  511.  
  512. BEGIN
  513.  
  514.   VMouseOff;
  515.  
  516. END;
  517.  
  518. {$ELSE}
  519.  
  520. BEGIN
  521.  
  522.   MouClose( MyHandle );
  523.  
  524. END;
  525.  
  526. {$ENDIF} { notdef os2 / else }
  527.  
  528. {────────────────────────────────────────────────────────────────────────────}
  529.  
  530.  
  531. (*-
  532.  
  533. [FUNCTION]
  534.  
  535. Procedure VMouseOn;
  536.  
  537.  
  538. [PARAMETERS]
  539.  
  540. None.
  541.  
  542. [RETURNS]
  543.  
  544. Nothing.
  545.  
  546. [DESCRIPTION]
  547.  
  548. This function turns the mouse pointer on and makes the mouse pointer
  549. visible.
  550.  
  551. [SEE-ALSO]
  552.  
  553. [EXAMPLE]
  554.  
  555. -*)
  556.  
  557.  
  558.  
  559. Procedure VMouseOn;
  560.  
  561. {$IFNDEF OS2}
  562.  
  563. Var
  564.  
  565.   R : REGISTERS;
  566.  
  567. BEGIN
  568.  
  569.   Case MyMouseType of
  570.  
  571.     1:
  572.     BEGIN
  573.  
  574.       R.AX := $01;
  575.       R.ES := $00;
  576.       R.DS := $00;
  577.  
  578.       Intr( $33, R );
  579.  
  580.     END
  581.  
  582.   END;
  583.  
  584. END;
  585.  
  586. {$ELSE}
  587.  
  588. BEGIN
  589.  
  590.  
  591.   If MyOffCount>0 Then
  592.     Dec( MyOffCount );
  593.  
  594.   If MyOffCount=0 Then
  595.     MouDrawPtr( MyHandle );
  596.  
  597.  
  598. END;
  599.  
  600. {$ENDIF} { notdef os2 / else }
  601.  
  602.  
  603. {────────────────────────────────────────────────────────────────────────────}
  604.  
  605.  
  606. (*-
  607.  
  608. [FUNCTION]
  609.  
  610. Procedure VMouseOff;
  611.  
  612.  
  613. [PARAMETERS]
  614.  
  615. None.
  616.  
  617. [RETURNS]
  618.  
  619. Nothing.
  620.  
  621. [DESCRIPTION]
  622.  
  623. This function turns the mouse pointer off and makes the mouse pointer
  624. invisible.
  625.  
  626. [SEE-ALSO]
  627.  
  628. [EXAMPLE]
  629.  
  630. -*)
  631.  
  632.  
  633.  
  634. Procedure VMouseOff;
  635.  
  636. {$IFNDEF OS2}
  637.  
  638. Var
  639.  
  640.   R : REGISTERS;
  641.  
  642. BEGIN
  643.  
  644.   Case MyMouseType of
  645.  
  646.     1:
  647.     BEGIN
  648.  
  649.       R.AX := $02;
  650.       R.ES := $00;
  651.       R.DS := $00;
  652.  
  653.       Intr( $33, R );
  654.  
  655.     END
  656.  
  657.   END;
  658.  
  659. END;
  660.  
  661. {$ELSE}
  662.  
  663. Var
  664.  
  665.   exrect : TNoPtrRect;
  666.  
  667. BEGIN
  668.  
  669.   { set the exclusion rectangle to cover the whole screen }
  670.  
  671.   exrect.TopRow    := 0;
  672.   exrect.TopCol    := 0;
  673.   exrect.BottomRow := 24;
  674.   exrect.bottomCol := 79;
  675.  
  676.   MouRemovePtr( @exrect, MyHandle );
  677.  
  678.   Inc( MyOffCount );
  679.  
  680. END;
  681.  
  682. {$ENDIF} { notdef os2 / else }
  683.  
  684. {────────────────────────────────────────────────────────────────────────────}
  685.  
  686.  
  687. (*-
  688.  
  689. [FUNCTION]
  690.  
  691. Procedure VMouseTypeSet(     PointerID   : BYTE       );
  692.  
  693. [PARAMETERS]
  694.  
  695. pointerid   mouse pointer type
  696.  
  697. [RETURNS]
  698.  
  699. Nothing.
  700.  
  701. [DESCRIPTION]
  702.  
  703. This function is not yet implemented.
  704.  
  705. [SEE-ALSO]
  706.  
  707. [EXAMPLE]
  708.  
  709. -*)
  710.  
  711.  
  712.  
  713. Procedure VMouseTypeSet(     PointerID   : BYTE       );
  714.  
  715. {$IFNDEF OS2}
  716.  
  717. Var
  718.  
  719.   R : REGISTERS;
  720.  
  721. BEGIN
  722.  
  723. END;
  724.  
  725. {$ELSE}
  726.  
  727. BEGIN
  728.  
  729. END;
  730.  
  731. {$ENDIF} { notdef os2 / else }
  732.  
  733. {────────────────────────────────────────────────────────────────────────────}
  734.  
  735.  
  736. (*-
  737.  
  738. [FUNCTION]
  739.  
  740. Procedure VMouseVertLimitSet(     MaxRow      : WORD       );
  741.  
  742. [PARAMETERS]
  743.  
  744. maxrow      maximum row for the mouse
  745.  
  746. [RETURNS]
  747.  
  748. Nothing.
  749.  
  750. [DESCRIPTION]
  751.  
  752. This function sets the maximum vertical limit of the mouse pointer.
  753.  
  754.  
  755. [SEE-ALSO]
  756.  
  757. [EXAMPLE]
  758.  
  759. -*)
  760.  
  761.  
  762. Procedure VMouseVertLimitSet(     MaxRow      : WORD       );
  763.  
  764. {$IFNDEF OS2}
  765.  
  766. Var
  767.  
  768.   R : REGISTERS;
  769.  
  770. BEGIN
  771.  
  772.   R.AX := $08;
  773.   R.CX := 0;
  774.   R.DX := (MaxRow-1) * 8;
  775.   R.ES := $0;
  776.   R.DS := $0;
  777.  
  778.   Intr( $33, R );
  779.  
  780. END;
  781.  
  782. {$ELSE}
  783.  
  784. BEGIN
  785.  
  786. END;
  787.  
  788. {$ENDIF}
  789.  
  790. {────────────────────────────────────────────────────────────────────────────}
  791.  
  792.  
  793. (*-
  794.  
  795. [FUNCTION]
  796.  
  797. Procedure VMouseRead(       Var Button      : BYTE;
  798.                             Var X           : WORD;
  799.                             Var Y           : WORD       );
  800.  
  801. [PARAMETERS]
  802.  
  803. buttons     (returned> currently pressed buttons
  804. x           (returned) current mouse x location
  805. y           (returned) current mouse y location
  806.  
  807. [RETURNS]
  808.  
  809. buttons     (returned> currently pressed buttons
  810. x           (returned) current mouse x location
  811. y           (returned) current mouse y location
  812.  
  813. [DESCRIPTION]
  814.  
  815. This function reads the current button settings and x and y location of the
  816. mouse.
  817.  
  818. The buttons variable will contain one of the following values:
  819.  
  820.   mbLEFT        = 1;
  821.   mbCENTER      = 8;
  822.   mbRIGHT       = 2;
  823.   mbLEFTRIGHT   = 1+2;
  824.   mbLEFTCENTER  = 1+8;
  825.   mbRIGHTCENTER = 2+8;
  826.   mbALL         = 1+2+8;
  827.  
  828.  
  829.  
  830. [SEE-ALSO]
  831.  
  832. [EXAMPLE]
  833.  
  834. -*)
  835.  
  836.  
  837.  
  838. Procedure VMouseRead(       Var Button      : BYTE;
  839.                             Var X           : WORD;
  840.                             Var Y           : WORD       );
  841.  
  842. {$IFNDEF OS2}
  843.  
  844. Var
  845.  
  846.   R : REGISTERS;
  847.  
  848. BEGIN
  849.  
  850.   Case MyMouseType of
  851.  
  852.     1:
  853.     BEGIN
  854.  
  855.       R.AX := 03;
  856.       R.ES := $0;
  857.       R.DS := $0;
  858.  
  859.       Intr( $33, R );
  860.  
  861.       Button := R.BX;
  862.  
  863.       {-----------------------------------}
  864.       { should we report pixels or cells? }
  865.       {-----------------------------------}
  866.  
  867.       If (MyMouseFlags and cmfReadPixels)>0 Then
  868.       BEGIN
  869.         X := R.CX;
  870.         Y := R.DX;
  871.       END
  872.       ELSE
  873.       BEGIN
  874.         X := ( R.CX + 8 ) DIV 8;
  875.         Y := ( R.DX + 8 ) DIV 8;
  876.       END;
  877.  
  878.     END
  879.  
  880.   END;
  881.  
  882. END;
  883.  
  884. {$ELSE}
  885.  
  886. Var
  887.  
  888.  PL : TPtrLoc;
  889.  
  890. BEGIN
  891.  
  892.   GetCurrentLastMEI;
  893.  
  894.   Button := ButtonTranslate( @MyLastMEI );
  895.  
  896.   X := Succ(MyLastMEI.Col);
  897.   Y := Succ(MyLastMEI.Row);
  898.  
  899. END;
  900.  
  901. {$ENDIF} { notdef os2 / else }
  902.  
  903.  
  904. {────────────────────────────────────────────────────────────────────────────}
  905.  
  906. (*-
  907.  
  908. [FUNCTION]
  909.  
  910. Function  VMouseReadButtons : BYTE;
  911.  
  912.  
  913. [PARAMETERS]
  914.  
  915. None.
  916.  
  917. [RETURNS]
  918.  
  919. buttons      currently pressed buttons
  920.  
  921. [DESCRIPTION]
  922.  
  923. This function reads the current mouse button settings.
  924.  
  925. The buttons variable will contain one of the following values:
  926.  
  927.   mbLEFT        = 1;
  928.   mbCENTER      = 8;
  929.   mbRIGHT       = 2;
  930.   mbLEFTRIGHT   = 1+2;
  931.   mbLEFTCENTER  = 1+8;
  932.   mbRIGHTCENTER = 2+8;
  933.   mbALL         = 1+2+8;
  934.  
  935.  
  936.  
  937. [SEE-ALSO]
  938.  
  939. [EXAMPLE]
  940.  
  941. -*)
  942.  
  943.  
  944. Function  VMouseReadButtons : BYTE;
  945.  
  946. Var
  947.  
  948.   X,Y : WORD;
  949.   B   : BYTE;
  950.  
  951. BEGIN
  952.  
  953.   VMouseRead( B, X, Y );
  954.  
  955.   VMouseReadButtons := B;
  956.  
  957. END;
  958.  
  959. {────────────────────────────────────────────────────────────────────────────}
  960.  
  961. (*-
  962.  
  963. [FUNCTION]
  964.  
  965. Function  VMouseReadX       : WORD;
  966.  
  967. [PARAMETERS]
  968.  
  969. None.
  970.  
  971. [RETURNS]
  972.  
  973. buttons      currently pressed buttons
  974.  
  975. [DESCRIPTION]
  976.  
  977. This function reads the current x location of the mouse.
  978.  
  979. [SEE-ALSO]
  980.  
  981. [EXAMPLE]
  982.  
  983. -*)
  984.  
  985.  
  986. Function  VMouseReadX       : WORD;
  987.  
  988. Var
  989.  
  990.   X,Y : WORD;
  991.   B   : BYTE;
  992.  
  993. BEGIN
  994.  
  995.   VMouseRead( B, X, Y );
  996.  
  997.   VMouseReadX := X;
  998.  
  999. END;
  1000.  
  1001. {────────────────────────────────────────────────────────────────────────────}
  1002.  
  1003. (*-
  1004.  
  1005. [FUNCTION]
  1006.  
  1007. Function  VMouseReadY       : WORD;
  1008.  
  1009. [PARAMETERS]
  1010.  
  1011. None.
  1012.  
  1013. [RETURNS]
  1014.  
  1015. buttons      currently pressed buttons
  1016.  
  1017. [DESCRIPTION]
  1018.  
  1019. This function reads the current y location of the mouse.
  1020.  
  1021. [SEE-ALSO]
  1022.  
  1023. [EXAMPLE]
  1024.  
  1025. -*)
  1026.  
  1027.  
  1028. Function  VMouseReadY       : WORD;
  1029.  
  1030. Var
  1031.  
  1032.   X,Y : WORD;
  1033.   B   : BYTE;
  1034.  
  1035. BEGIN
  1036.  
  1037.   VMouseRead( B, X, Y );
  1038.  
  1039.   VMouseReadY := Y;
  1040.  
  1041. END;
  1042.  
  1043. {────────────────────────────────────────────────────────────────────────────}
  1044.  
  1045. (*-
  1046.  
  1047. [FUNCTION]
  1048.  
  1049. Procedure VMouseWaitRelease(        Buttons     : BYTE       );
  1050.  
  1051. [PARAMETERS]
  1052.  
  1053. None.
  1054.  
  1055. [RETURNS]
  1056.  
  1057. None.
  1058.  
  1059. [DESCRIPTION]
  1060.  
  1061. This function waits until all mouse buttons are released.
  1062.  
  1063. [SEE-ALSO]
  1064.  
  1065. [EXAMPLE]
  1066.  
  1067. -*)
  1068.  
  1069.  
  1070. Procedure VMouseWaitRelease(        Buttons     : BYTE       );
  1071.  
  1072. Var
  1073.  
  1074.   X,Y : WORD;
  1075.   B   : BYTE;
  1076.  
  1077. BEGIN
  1078.  
  1079.   Repeat
  1080.     VMouseRead( B, X, Y );
  1081.   Until B=0;
  1082.  
  1083. END;
  1084.  
  1085. {────────────────────────────────────────────────────────────────────────────}
  1086.  
  1087. (*-
  1088.  
  1089. [FUNCTION]
  1090.  
  1091. Procedure VMouseWaitPress(          Buttons     : BYTE       );
  1092.  
  1093. [PARAMETERS]
  1094.  
  1095. None.
  1096.  
  1097. [RETURNS]
  1098.  
  1099. None.
  1100.  
  1101. [DESCRIPTION]
  1102.  
  1103. This function waits until a mouse button is pressed.
  1104.  
  1105. [SEE-ALSO]
  1106.  
  1107. [EXAMPLE]
  1108.  
  1109. -*)
  1110.  
  1111.  
  1112.  
  1113. Procedure VMouseWaitPress(          Buttons     : BYTE       );
  1114.  
  1115. Var
  1116.  
  1117.   X,Y : WORD;
  1118.   B   : BYTE;
  1119.  
  1120. BEGIN
  1121.  
  1122.   Repeat
  1123.     VMouseRead( B, X, Y );
  1124.   Until B<>0;
  1125.  
  1126. END;
  1127.  
  1128.  
  1129. {────────────────────────────────────────────────────────────────────────────}
  1130.  
  1131. (*
  1132.  
  1133. Procedure VMouseProcNew(              BPressed    : BYTE;
  1134.                                       BReleased   : BYTE;
  1135.                                       X1          : WORD;
  1136.                                       Y1          : WORD;
  1137.                                       X2          : WORD;
  1138.                                       Y2          : WORD;
  1139.                                       Proc        : POINTER;
  1140.                                       Id          : POINTER;
  1141.                                       Name        : TProcName;
  1142.                                   Var Err         : WORD       );
  1143.  
  1144. BEGIN
  1145. END;
  1146.  
  1147. {────────────────────────────────────────────────────────────────────────────}
  1148.  
  1149. Procedure VMouseProcOn(               Name        : TProcName  );
  1150.  
  1151. BEGIN
  1152. END;
  1153.  
  1154. {────────────────────────────────────────────────────────────────────────────}
  1155.  
  1156. Procedure VMouseProcOff(              Name        : TProcName  );
  1157.  
  1158. BEGIN
  1159. END;
  1160.  
  1161. {────────────────────────────────────────────────────────────────────────────}
  1162.  
  1163. Procedure VMouseProcDispose(          Name        : TProcName  );
  1164.  
  1165. BEGIN
  1166. END;
  1167.  
  1168. {────────────────────────────────────────────────────────────────────────────}
  1169.  
  1170. Procedure VMouseSubmitButtonKey(      Button      : BYTE;
  1171.                                       Key1        : CHAR;
  1172.                                       Key2        : CHAR       );
  1173.  
  1174. BEGIN
  1175. END;
  1176.  
  1177. *)
  1178.  
  1179. {────────────────────────────────────────────────────────────────────────────}
  1180. {────────────────────────────────────────────────────────────────────────────}
  1181. {────────────────────────────────────────────────────────────────────────────}
  1182.  
  1183. BEGIN
  1184. END.
  1185.