Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4095
Number of posts: 14004

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Using the Mouse in Pascal Posted by NinthAngle on 11 Dec 2006 at 11:08 AM
1. How do I use the mouse in pascal? Im trying to have a program react to the left and right mouse click...

2. Furthermore I am trying to store the information I collect in the way in a txt file. Ive programmed pascal to store keys the program user enters in a .dat file but i expect that this process will have no way of storing which mouse button is clicked just like it cannot store the left or right key stroke but uses an empty space to do this... Is there any way around this?
Report
Re: Using the Mouse in Pascal Posted by zibadian on 11 Dec 2006 at 12:46 PM
: 1. How do I use the mouse in pascal? Im trying to have a program react to the left and right mouse click...
:
: 2. Furthermore I am trying to store the information I collect in the way in a txt file. Ive programmed pascal to store keys the program user enters in a .dat file but i expect that this process will have no way of storing which mouse button is clicked just like it cannot store the left or right key stroke but uses an empty space to do this... Is there any way around this?
:
In TP6+, you can use the Mouse unit. This unit defines the TMouse object, which can be used to gain access to the mouse routines. The mouse unit also defines several constants which are returned in response to the various button clicks. You can store those constants in a text file.
Report
Re: Using the Mouse in Pascal Posted by NinthAngle on 11 Dec 2006 at 2:17 PM
: : 1. How do I use the mouse in pascal? Im trying to have a program react to the left and right mouse click...
: :
: : 2. Furthermore I am trying to store the information I collect in the way in a txt file. Ive programmed pascal to store keys the program user enters in a .dat file but i expect that this process will have no way of storing which mouse button is clicked just like it cannot store the left or right key stroke but uses an empty space to do this... Is there any way around this?
: :
: In TP6+, you can use the Mouse unit. This unit defines the TMouse object, which can be used to gain access to the mouse routines. The mouse unit also defines several constants which are returned in response to the various button clicks. You can store those constants in a text file.
:

I have TP7 and I just looked up "mouse" in the index, but for some strange reason my index is now in french??? even though all the other menus in tp are english. Is there any way for me to fix this?

Is ther eanother place I can learn more about how to use the mouse in tp beside this forum and the index?
Report
Re: Using the Mouse in Pascal Posted by Alcatiz on 12 Dec 2006 at 1:27 PM
: : : 1. How do I use the mouse in pascal? Im trying to have a program react to the left and right mouse click...
: : :
: : : 2. Furthermore I am trying to store the information I collect in the way in a txt file. Ive programmed pascal to store keys the program user enters in a .dat file but i expect that this process will have no way of storing which mouse button is clicked just like it cannot store the left or right key stroke but uses an empty space to do this... Is there any way around this?
: : :
: : In TP6+, you can use the Mouse unit. This unit defines the TMouse object, which can be used to gain access to the mouse routines. The mouse unit also defines several constants which are returned in response to the various button clicks. You can store those constants in a text file.
: :
:
: I have TP7 and I just looked up "mouse" in the index, but for some strange reason my index is now in french??? even though all the other menus in tp are english. Is there any way for me to fix this?
:
: Is ther eanother place I can learn more about how to use the mouse in tp beside this forum and the index?
:
Hi !

The only version of Turbo Pascal 7 released by Borland to public domain is the French one. In a legal way you can find the TP 5.5 English help files.
Report
Re: Using the Mouse in Pascal Posted by Phat Nat on 12 Dec 2006 at 5:27 PM
This message was edited by Phat Nat at 2006-12-12 17:31:50

: 1. How do I use the mouse in pascal? Im trying to have a program react to the left and right mouse click...
:
: 2. Furthermore I am trying to store the information I collect in the way in a txt file. Ive programmed pascal to store keys the program user enters in a .dat file but i expect that this process will have no way of storing which mouse button is clicked just like it cannot store the left or right key stroke but uses an empty space to do this... Is there any way around this?
:

For storing the Left & Right keystrokes you need to read READKEY twice. The first time will return a "0" (meaning extended function) and the second key will be the real keystroke value (75=Left 77=Right)
If these values are found, you could store them as characters 27 & 26 (<Left Arrow> & <Right Arrow>) for easier deciphering.

As for the Mouse, if you're using TP7 this will work (as it supports inline assembly). It's not in a unit, but it will get the job done. It will give you the X, Y & Buttons of the mouse.
Mouse Buttons: Lf=1, Rt=2, Lf&Rt=3, Cn=4, Lf&Cn=5, etc

PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte); Assembler;
ASM
   Mov Ax, $0003           { Function 3 = Get Mouse X,Y & Buttons }
   Int $33                 { Int $33 = Mouse Functions }
   Shr Cx, 1               { Divide MouseX by 2 }
   Les Di, MouseX          { ES:DI = @MouseX }
   Mov Es:[Di], Cx         { MouseX is returned as 0-639, I want 0-319 }
   Les Di, MouseY          { ES:DI = @MouseY }
   Mov Es:[Di], Dx         { MouseY is returned as 0-199 }
   Les Di, MouseB          { ES:DI = @MouseB }
   Mov Es:[Di], Bl         { Mouse Buttons }
End;


Hope this is what you need.
Phat Nat

PS - Thought you may want these too:
PROCEDURE ShowMouse; Assembler;
ASM
   Mov Ax, $0001      { Function 1 = Show Mouse Cursor }
   Int $33            { Int $33 = Mouse Functions }
End;

PROCEDURE HideMouse; Assembler;
ASM
   Mov Ax, $0000      { Function 0 = Hide Mouse Cursor }
   Int $33            { Int $33 = Mouse Functions }
End;






Report
Re: Using the Mouse in Pascal Posted by NinthAngle on 14 Dec 2006 at 9:55 AM
: This message was edited by Phat Nat at 2006-12-12 17:31:50

: : 1. How do I use the mouse in pascal? Im trying to have a program react to the left and right mouse click...
: :
: : 2. Furthermore I am trying to store the information I collect in the way in a txt file. Ive programmed pascal to store keys the program user enters in a .dat file but i expect that this process will have no way of storing which mouse button is clicked just like it cannot store the left or right key stroke but uses an empty space to do this... Is there any way around this?
: :
:
: For storing the Left & Right keystrokes you need to read READKEY twice. The first time will return a "0" (meaning extended function) and the second key will be the real keystroke value (75=Left 77=Right)
: If these values are found, you could store them as characters 27 & 26 (<Left Arrow> & <Right Arrow>) for easier deciphering.
:
: As for the Mouse, if you're using TP7 this will work (as it supports inline assembly). It's not in a unit, but it will get the job done. It will give you the X, Y & Buttons of the mouse.
: Mouse Buttons: Lf=1, Rt=2, Lf&Rt=3, Cn=4, Lf&Cn=5, etc
:
:
: PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte); Assembler;
: ASM
:    Mov Ax, $0003           { Function 3 = Get Mouse X,Y & Buttons }
:    Int $33                 { Int $33 = Mouse Functions }
:    Shr Cx, 1               { Divide MouseX by 2 }
:    Les Di, MouseX          { ES:DI = @MouseX }
:    Mov Es:[Di], Cx         { MouseX is returned as 0-639, I want 0-319 }
:    Les Di, MouseY          { ES:DI = @MouseY }
:    Mov Es:[Di], Dx         { MouseY is returned as 0-199 }
:    Les Di, MouseB          { ES:DI = @MouseB }
:    Mov Es:[Di], Bl         { Mouse Buttons }
: End;
: 

:
: Hope this is what you need.
: Phat Nat
:
: PS - Thought you may want these too:
:
: PROCEDURE ShowMouse; Assembler;
: ASM
:    Mov Ax, $0001      { Function 1 = Show Mouse Cursor }
:    Int $33            { Int $33 = Mouse Functions }
: End;
: 
: PROCEDURE HideMouse; Assembler;
: ASM
:    Mov Ax, $0000      { Function 0 = Hide Mouse Cursor }
:    Int $33            { Int $33 = Mouse Functions }
: End;
: 

:
:
:
:
:
:


Hi PhatNat,
thanks for your reply, as always. One question, Im trying to use this procedure in a pascal program:

PROGRAM Mouze;
USES Crt;


PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte); Assembler;
ASM
Mov Ax, $0003 { Function 3 = Get Mouse X,Y & Buttons }
Int $33 { Int $33 = Mouse Functions }
Shr Cx, 1 { Divide MouseX by 2 }
Les Di, MouseX { ES:DI = @MouseX }
Mov Es:[Di], Cx { MouseX is returned as 0-639, I want 0-319 }
Les Di, MouseY { ES:DI = @MouseY }
Mov Es:[Di], Dx { MouseY is returned as 0-199 }
Les Di, MouseB { ES:DI = @MouseB }
Mov Es:[Di], Bl { Mouse Buttons }
End;

BEGIN
GetMouse;
END.

When I try to compile this i get "Error 88:"(" Expected. Fro the bit of research i did i gather that not every procedure needs to be followed by a bracket... What should I put in the brackets?

thx!
NA
Report
Re: Using the Mouse in Pascal Posted by zibadian on 14 Dec 2006 at 12:27 PM
: : This message was edited by Phat Nat at 2006-12-12 17:31:50

: : : 1. How do I use the mouse in pascal? Im trying to have a program react to the left and right mouse click...
: : :
: : : 2. Furthermore I am trying to store the information I collect in the way in a txt file. Ive programmed pascal to store keys the program user enters in a .dat file but i expect that this process will have no way of storing which mouse button is clicked just like it cannot store the left or right key stroke but uses an empty space to do this... Is there any way around this?
: : :
: :
: : For storing the Left & Right keystrokes you need to read READKEY twice. The first time will return a "0" (meaning extended function) and the second key will be the real keystroke value (75=Left 77=Right)
: : If these values are found, you could store them as characters 27 & 26 (<Left Arrow> & <Right Arrow>) for easier deciphering.
: :
: : As for the Mouse, if you're using TP7 this will work (as it supports inline assembly). It's not in a unit, but it will get the job done. It will give you the X, Y & Buttons of the mouse.
: : Mouse Buttons: Lf=1, Rt=2, Lf&Rt=3, Cn=4, Lf&Cn=5, etc
: :
: :
: : PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte); Assembler;
: : ASM
: :    Mov Ax, $0003           { Function 3 = Get Mouse X,Y & Buttons }
: :    Int $33                 { Int $33 = Mouse Functions }
: :    Shr Cx, 1               { Divide MouseX by 2 }
: :    Les Di, MouseX          { ES:DI = @MouseX }
: :    Mov Es:[Di], Cx         { MouseX is returned as 0-639, I want 0-319 }
: :    Les Di, MouseY          { ES:DI = @MouseY }
: :    Mov Es:[Di], Dx         { MouseY is returned as 0-199 }
: :    Les Di, MouseB          { ES:DI = @MouseB }
: :    Mov Es:[Di], Bl         { Mouse Buttons }
: : End;
: : 

: :
: : Hope this is what you need.
: : Phat Nat
: :
: : PS - Thought you may want these too:
: :
: : PROCEDURE ShowMouse; Assembler;
: : ASM
: :    Mov Ax, $0001      { Function 1 = Show Mouse Cursor }
: :    Int $33            { Int $33 = Mouse Functions }
: : End;
: : 
: : PROCEDURE HideMouse; Assembler;
: : ASM
: :    Mov Ax, $0000      { Function 0 = Hide Mouse Cursor }
: :    Int $33            { Int $33 = Mouse Functions }
: : End;
: : 

: :
: :
: :
: :
: :
: :
:
:
: Hi PhatNat,
: thanks for your reply, as always. One question, Im trying to use this procedure in a pascal program:
:
: PROGRAM Mouze;
: USES Crt;
:
:
: PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte); Assembler;
: ASM
: Mov Ax, $0003 { Function 3 = Get Mouse X,Y & Buttons }
: Int $33 { Int $33 = Mouse Functions }
: Shr Cx, 1 { Divide MouseX by 2 }
: Les Di, MouseX { ES:DI = @MouseX }
: Mov Es:[Di], Cx { MouseX is returned as 0-639, I want 0-319 }
: Les Di, MouseY { ES:DI = @MouseY }
: Mov Es:[Di], Dx { MouseY is returned as 0-199 }
: Les Di, MouseB { ES:DI = @MouseB }
: Mov Es:[Di], Bl { Mouse Buttons }
: End;
:
: BEGIN
: GetMouse;
: END.
:
: When I try to compile this i get "Error 88:"(" Expected. Fro the bit of research i did i gather that not every procedure needs to be followed by a bracket... What should I put in the brackets?
:
: thx!
: NA
:
The variables to receive the location of the mouse cursor and buttons, i.e.:
VAR MouseX, MouseY : Word; VAR MouseB : Byte

as seen in the declaration of the procedure.

Report
Re: Using the Mouse in Pascal Posted by NinthAngle on 19 Dec 2006 at 1:25 PM
: : : This message was edited by Phat Nat at 2006-12-12 17:31:50

: : : : 1. How do I use the mouse in pascal? Im trying to have a program react to the left and right mouse click...
: : : :
: : : : 2. Furthermore I am trying to store the information I collect in the way in a txt file. Ive programmed pascal to store keys the program user enters in a .dat file but i expect that this process will have no way of storing which mouse button is clicked just like it cannot store the left or right key stroke but uses an empty space to do this... Is there any way around this?
: : : :
: : :
: : : For storing the Left & Right keystrokes you need to read READKEY twice. The first time will return a "0" (meaning extended function) and the second key will be the real keystroke value (75=Left 77=Right)
: : : If these values are found, you could store them as characters 27 & 26 (<Left Arrow> & <Right Arrow>) for easier deciphering.
: : :
: : : As for the Mouse, if you're using TP7 this will work (as it supports inline assembly). It's not in a unit, but it will get the job done. It will give you the X, Y & Buttons of the mouse.
: : : Mouse Buttons: Lf=1, Rt=2, Lf&Rt=3, Cn=4, Lf&Cn=5, etc
: : :
: : :
: : : PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte); Assembler;
: : : ASM
: : :    Mov Ax, $0003           { Function 3 = Get Mouse X,Y & Buttons }
: : :    Int $33                 { Int $33 = Mouse Functions }
: : :    Shr Cx, 1               { Divide MouseX by 2 }
: : :    Les Di, MouseX          { ES:DI = @MouseX }
: : :    Mov Es:[Di], Cx         { MouseX is returned as 0-639, I want 0-319 }
: : :    Les Di, MouseY          { ES:DI = @MouseY }
: : :    Mov Es:[Di], Dx         { MouseY is returned as 0-199 }
: : :    Les Di, MouseB          { ES:DI = @MouseB }
: : :    Mov Es:[Di], Bl         { Mouse Buttons }
: : : End;
: : : 

: : :
: : : Hope this is what you need.
: : : Phat Nat
: : :
: : : PS - Thought you may want these too:
: : :
: : : PROCEDURE ShowMouse; Assembler;
: : : ASM
: : :    Mov Ax, $0001      { Function 1 = Show Mouse Cursor }
: : :    Int $33            { Int $33 = Mouse Functions }
: : : End;
: : : 
: : : PROCEDURE HideMouse; Assembler;
: : : ASM
: : :    Mov Ax, $0000      { Function 0 = Hide Mouse Cursor }
: : :    Int $33            { Int $33 = Mouse Functions }
: : : End;
: : : 

: : :
: : :
: : :
: : :
: : :
: : :
: :
: :
: : Hi PhatNat,
: : thanks for your reply, as always. One question, Im trying to use this procedure in a pascal program:
: :
: : PROGRAM Mouze;
: : USES Crt;
: :
: :
: : PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte); Assembler;
: : ASM
: : Mov Ax, $0003 { Function 3 = Get Mouse X,Y & Buttons }
: : Int $33 { Int $33 = Mouse Functions }
: : Shr Cx, 1 { Divide MouseX by 2 }
: : Les Di, MouseX { ES:DI = @MouseX }
: : Mov Es:[Di], Cx { MouseX is returned as 0-639, I want 0-319 }
: : Les Di, MouseY { ES:DI = @MouseY }
: : Mov Es:[Di], Dx { MouseY is returned as 0-199 }
: : Les Di, MouseB { ES:DI = @MouseB }
: : Mov Es:[Di], Bl { Mouse Buttons }
: : End;
: :
: : BEGIN
: : GetMouse;
: : END.
: :
: : When I try to compile this i get "Error 88:"(" Expected. Fro the bit of research i did i gather that not every procedure needs to be followed by a bracket... What should I put in the brackets?
: :
: : thx!
: : NA
: :
: The variables to receive the location of the mouse cursor and buttons, i.e.:
:
: VAR MouseX, MouseY : Word; VAR MouseB : Byte
: 

: as seen in the declaration of the procedure.
:
:


But I still have no way of knowing what MouseX and MouseY etc are? Simply entering these variables does not get me anywhere. What should I do to avoid this error "Error 88"?

thx so much!
NA
Report
Re: Using the Mouse in Pascal Posted by zibadian on 19 Dec 2006 at 3:59 PM
: : : : This message was edited by Phat Nat at 2006-12-12 17:31:50

: : : : : 1. How do I use the mouse in pascal? Im trying to have a program react to the left and right mouse click...
: : : : :
: : : : : 2. Furthermore I am trying to store the information I collect in the way in a txt file. Ive programmed pascal to store keys the program user enters in a .dat file but i expect that this process will have no way of storing which mouse button is clicked just like it cannot store the left or right key stroke but uses an empty space to do this... Is there any way around this?
: : : : :
: : : :
: : : : For storing the Left & Right keystrokes you need to read READKEY twice. The first time will return a "0" (meaning extended function) and the second key will be the real keystroke value (75=Left 77=Right)
: : : : If these values are found, you could store them as characters 27 & 26 (<Left Arrow> & <Right Arrow>) for easier deciphering.
: : : :
: : : : As for the Mouse, if you're using TP7 this will work (as it supports inline assembly). It's not in a unit, but it will get the job done. It will give you the X, Y & Buttons of the mouse.
: : : : Mouse Buttons: Lf=1, Rt=2, Lf&Rt=3, Cn=4, Lf&Cn=5, etc
: : : :
: : : :
: : : : PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte); Assembler;
: : : : ASM
: : : :    Mov Ax, $0003           { Function 3 = Get Mouse X,Y & Buttons }
: : : :    Int $33                 { Int $33 = Mouse Functions }
: : : :    Shr Cx, 1               { Divide MouseX by 2 }
: : : :    Les Di, MouseX          { ES:DI = @MouseX }
: : : :    Mov Es:[Di], Cx         { MouseX is returned as 0-639, I want 0-319 }
: : : :    Les Di, MouseY          { ES:DI = @MouseY }
: : : :    Mov Es:[Di], Dx         { MouseY is returned as 0-199 }
: : : :    Les Di, MouseB          { ES:DI = @MouseB }
: : : :    Mov Es:[Di], Bl         { Mouse Buttons }
: : : : End;
: : : : 

: : : :
: : : : Hope this is what you need.
: : : : Phat Nat
: : : :
: : : : PS - Thought you may want these too:
: : : :
: : : : PROCEDURE ShowMouse; Assembler;
: : : : ASM
: : : :    Mov Ax, $0001      { Function 1 = Show Mouse Cursor }
: : : :    Int $33            { Int $33 = Mouse Functions }
: : : : End;
: : : : 
: : : : PROCEDURE HideMouse; Assembler;
: : : : ASM
: : : :    Mov Ax, $0000      { Function 0 = Hide Mouse Cursor }
: : : :    Int $33            { Int $33 = Mouse Functions }
: : : : End;
: : : : 

: : : :
: : : :
: : : :
: : : :
: : : :
: : : :
: : :
: : :
: : : Hi PhatNat,
: : : thanks for your reply, as always. One question, Im trying to use this procedure in a pascal program:
: : :
: : : PROGRAM Mouze;
: : : USES Crt;
: : :
: : :
: : : PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte); Assembler;
: : : ASM
: : : Mov Ax, $0003 { Function 3 = Get Mouse X,Y & Buttons }
: : : Int $33 { Int $33 = Mouse Functions }
: : : Shr Cx, 1 { Divide MouseX by 2 }
: : : Les Di, MouseX { ES:DI = @MouseX }
: : : Mov Es:[Di], Cx { MouseX is returned as 0-639, I want 0-319 }
: : : Les Di, MouseY { ES:DI = @MouseY }
: : : Mov Es:[Di], Dx { MouseY is returned as 0-199 }
: : : Les Di, MouseB { ES:DI = @MouseB }
: : : Mov Es:[Di], Bl { Mouse Buttons }
: : : End;
: : :
: : : BEGIN
: : : GetMouse;
: : : END.
: : :
: : : When I try to compile this i get "Error 88:"(" Expected. Fro the bit of research i did i gather that not every procedure needs to be followed by a bracket... What should I put in the brackets?
: : :
: : : thx!
: : : NA
: : :
: : The variables to receive the location of the mouse cursor and buttons, i.e.:
: :
: : VAR MouseX, MouseY : Word; VAR MouseB : Byte
: : 

: : as seen in the declaration of the procedure.
: :
: :
:
:
: But I still have no way of knowing what MouseX and MouseY etc are? Simply entering these variables does not get me anywhere. What should I do to avoid this error "Error 88"?
:
: thx so much!
: NA
:
You don't need to enter the variables. These variables are set by the procedure GetMouse(), and hold the location of the mouse. If you want to do something using the mouse position, you can read those variables.
This example shows the mouse coordinates on the screen:
begin
  repeat
    GetMouse(MouseX, MouseY, MouseB); { Sets the variables }
    GotoXY(1, 1);
    writeln(MouseX, MouseY); { Uses the location }
  until MouseB > 0; { Checks if the user clicks to end the program }
end;


Report
Re: Using the Mouse in Pascal Posted by NinthAngle on 25 Dec 2006 at 2:26 PM
: : : : : This message was edited by Phat Nat at 2006-12-12 17:31:50

: : : : : : 1. How do I use the mouse in pascal? Im trying to have a program react to the left and right mouse click...
: : : : : :
: : : : : : 2. Furthermore I am trying to store the information I collect in the way in a txt file. Ive programmed pascal to store keys the program user enters in a .dat file but i expect that this process will have no way of storing which mouse button is clicked just like it cannot store the left or right key stroke but uses an empty space to do this... Is there any way around this?
: : : : : :
: : : : :
: : : : : For storing the Left & Right keystrokes you need to read READKEY twice. The first time will return a "0" (meaning extended function) and the second key will be the real keystroke value (75=Left 77=Right)
: : : : : If these values are found, you could store them as characters 27 & 26 (<Left Arrow> & <Right Arrow>) for easier deciphering.
: : : : :
: : : : : As for the Mouse, if you're using TP7 this will work (as it supports inline assembly). It's not in a unit, but it will get the job done. It will give you the X, Y & Buttons of the mouse.
: : : : : Mouse Buttons: Lf=1, Rt=2, Lf&Rt=3, Cn=4, Lf&Cn=5, etc
: : : : :
: : : : :
: : : : : PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte); Assembler;
: : : : : ASM
: : : : :    Mov Ax, $0003           { Function 3 = Get Mouse X,Y & Buttons }
: : : : :    Int $33                 { Int $33 = Mouse Functions }
: : : : :    Shr Cx, 1               { Divide MouseX by 2 }
: : : : :    Les Di, MouseX          { ES:DI = @MouseX }
: : : : :    Mov Es:[Di], Cx         { MouseX is returned as 0-639, I want 0-319 }
: : : : :    Les Di, MouseY          { ES:DI = @MouseY }
: : : : :    Mov Es:[Di], Dx         { MouseY is returned as 0-199 }
: : : : :    Les Di, MouseB          { ES:DI = @MouseB }
: : : : :    Mov Es:[Di], Bl         { Mouse Buttons }
: : : : : End;
: : : : : 

: : : : :
: : : : : Hope this is what you need.
: : : : : Phat Nat
: : : : :
: : : : : PS - Thought you may want these too:
: : : : :
: : : : : PROCEDURE ShowMouse; Assembler;
: : : : : ASM
: : : : :    Mov Ax, $0001      { Function 1 = Show Mouse Cursor }
: : : : :    Int $33            { Int $33 = Mouse Functions }
: : : : : End;
: : : : : 
: : : : : PROCEDURE HideMouse; Assembler;
: : : : : ASM
: : : : :    Mov Ax, $0000      { Function 0 = Hide Mouse Cursor }
: : : : :    Int $33            { Int $33 = Mouse Functions }
: : : : : End;
: : : : : 

: : : : :
: : : : :
: : : : :
: : : : :
: : : : :
: : : : :
: : : :
: : : :
: : : : Hi PhatNat,
: : : : thanks for your reply, as always. One question, Im trying to use this procedure in a pascal program:
: : : :
: : : : PROGRAM Mouze;
: : : : USES Crt;
: : : :
: : : :
: : : : PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte); Assembler;
: : : : ASM
: : : : Mov Ax, $0003 { Function 3 = Get Mouse X,Y & Buttons }
: : : : Int $33 { Int $33 = Mouse Functions }
: : : : Shr Cx, 1 { Divide MouseX by 2 }
: : : : Les Di, MouseX { ES:DI = @MouseX }
: : : : Mov Es:[Di], Cx { MouseX is returned as 0-639, I want 0-319 }
: : : : Les Di, MouseY { ES:DI = @MouseY }
: : : : Mov Es:[Di], Dx { MouseY is returned as 0-199 }
: : : : Les Di, MouseB { ES:DI = @MouseB }
: : : : Mov Es:[Di], Bl { Mouse Buttons }
: : : : End;
: : : :
: : : : BEGIN
: : : : GetMouse;
: : : : END.
: : : :
: : : : When I try to compile this i get "Error 88:"(" Expected. Fro the bit of research i did i gather that not every procedure needs to be followed by a bracket... What should I put in the brackets?
: : : :
: : : : thx!
: : : : NA
: : : :
: : : The variables to receive the location of the mouse cursor and buttons, i.e.:
: : :
: : : VAR MouseX, MouseY : Word; VAR MouseB : Byte
: : : 

: : : as seen in the declaration of the procedure.
: : :
: : :
: :
: :
: : But I still have no way of knowing what MouseX and MouseY etc are? Simply entering these variables does not get me anywhere. What should I do to avoid this error "Error 88"?
: :
: : thx so much!
: : NA
: :
: You don't need to enter the variables. These variables are set by the procedure GetMouse(), and hold the location of the mouse. If you want to do something using the mouse position, you can read those variables.
: This example shows the mouse coordinates on the screen:
:
: begin
:   repeat
:     GetMouse(MouseX, MouseY, MouseB); { Sets the variables }
:     GotoXY(1, 1);
:     writeln(MouseX, MouseY); { Uses the location }
:   until MouseB > 0; { Checks if the user clicks to end the program }
: end;
: 

:
:

and what type should these variables be? I tried string and integer, both didnt work...:(

Report
Re: Using the Mouse in Pascal Posted by zibadian on 26 Dec 2006 at 5:13 AM
: : : : : : This message was edited by Phat Nat at 2006-12-12 17:31:50

: : : : : : : 1. How do I use the mouse in pascal? Im trying to have a program react to the left and right mouse click...
: : : : : : :
: : : : : : : 2. Furthermore I am trying to store the information I collect in the way in a txt file. Ive programmed pascal to store keys the program user enters in a .dat file but i expect that this process will have no way of storing which mouse button is clicked just like it cannot store the left or right key stroke but uses an empty space to do this... Is there any way around this?
: : : : : : :
: : : : : :
: : : : : : For storing the Left & Right keystrokes you need to read READKEY twice. The first time will return a "0" (meaning extended function) and the second key will be the real keystroke value (75=Left 77=Right)
: : : : : : If these values are found, you could store them as characters 27 & 26 (<Left Arrow> & <Right Arrow>) for easier deciphering.
: : : : : :
: : : : : : As for the Mouse, if you're using TP7 this will work (as it supports inline assembly). It's not in a unit, but it will get the job done. It will give you the X, Y & Buttons of the mouse.
: : : : : : Mouse Buttons: Lf=1, Rt=2, Lf&Rt=3, Cn=4, Lf&Cn=5, etc
: : : : : :
: : : : : :
: : : : : : PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte); Assembler;
: : : : : : ASM
: : : : : :    Mov Ax, $0003           { Function 3 = Get Mouse X,Y & Buttons }
: : : : : :    Int $33                 { Int $33 = Mouse Functions }
: : : : : :    Shr Cx, 1               { Divide MouseX by 2 }
: : : : : :    Les Di, MouseX          { ES:DI = @MouseX }
: : : : : :    Mov Es:[Di], Cx         { MouseX is returned as 0-639, I want 0-319 }
: : : : : :    Les Di, MouseY          { ES:DI = @MouseY }
: : : : : :    Mov Es:[Di], Dx         { MouseY is returned as 0-199 }
: : : : : :    Les Di, MouseB          { ES:DI = @MouseB }
: : : : : :    Mov Es:[Di], Bl         { Mouse Buttons }
: : : : : : End;
: : : : : : 

: : : : : :
: : : : : : Hope this is what you need.
: : : : : : Phat Nat
: : : : : :
: : : : : : PS - Thought you may want these too:
: : : : : :
: : : : : : PROCEDURE ShowMouse; Assembler;
: : : : : : ASM
: : : : : :    Mov Ax, $0001      { Function 1 = Show Mouse Cursor }
: : : : : :    Int $33            { Int $33 = Mouse Functions }
: : : : : : End;
: : : : : : 
: : : : : : PROCEDURE HideMouse; Assembler;
: : : : : : ASM
: : : : : :    Mov Ax, $0000      { Function 0 = Hide Mouse Cursor }
: : : : : :    Int $33            { Int $33 = Mouse Functions }
: : : : : : End;
: : : : : : 

: : : : : :
: : : : : :
: : : : : :
: : : : : :
: : : : : :
: : : : : :
: : : : :
: : : : :
: : : : : Hi PhatNat,
: : : : : thanks for your reply, as always. One question, Im trying to use this procedure in a pascal program:
: : : : :
: : : : : PROGRAM Mouze;
: : : : : USES Crt;
: : : : :
: : : : :
: : : : : PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte); Assembler;
: : : : : ASM
: : : : : Mov Ax, $0003 { Function 3 = Get Mouse X,Y & Buttons }
: : : : : Int $33 { Int $33 = Mouse Functions }
: : : : : Shr Cx, 1 { Divide MouseX by 2 }
: : : : : Les Di, MouseX { ES:DI = @MouseX }
: : : : : Mov Es:[Di], Cx { MouseX is returned as 0-639, I want 0-319 }
: : : : : Les Di, MouseY { ES:DI = @MouseY }
: : : : : Mov Es:[Di], Dx { MouseY is returned as 0-199 }
: : : : : Les Di, MouseB { ES:DI = @MouseB }
: : : : : Mov Es:[Di], Bl { Mouse Buttons }
: : : : : End;
: : : : :
: : : : : BEGIN
: : : : : GetMouse;
: : : : : END.
: : : : :
: : : : : When I try to compile this i get "Error 88:"(" Expected. Fro the bit of research i did i gather that not every procedure needs to be followed by a bracket... What should I put in the brackets?
: : : : :
: : : : : thx!
: : : : : NA
: : : : :
: : : : The variables to receive the location of the mouse cursor and buttons, i.e.:
: : : :
: : : : VAR MouseX, MouseY : Word; VAR MouseB : Byte
: : : : 

: : : : as seen in the declaration of the procedure.
: : : :
: : : :
: : :
: : :
: : : But I still have no way of knowing what MouseX and MouseY etc are? Simply entering these variables does not get me anywhere. What should I do to avoid this error "Error 88"?
: : :
: : : thx so much!
: : : NA
: : :
: : You don't need to enter the variables. These variables are set by the procedure GetMouse(), and hold the location of the mouse. If you want to do something using the mouse position, you can read those variables.
: : This example shows the mouse coordinates on the screen:
: :
: : begin
: :   repeat
: :     GetMouse(MouseX, MouseY, MouseB); { Sets the variables }
: :     GotoXY(1, 1);
: :     writeln(MouseX, MouseY); { Uses the location }
: :   until MouseB > 0; { Checks if the user clicks to end the program }
: : end;
: : 

: :
: :
:
: and what type should these variables be? I tried string and integer, both didnt work...:(
:
:
As you can see from this code:
PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte);

they must be word and byte. Var parameters must be precisely the same as specified in the procedure declaration.
Report
Re: Using the Mouse in Pascal Posted by NinthAngle on 26 Dec 2006 at 11:49 AM
: : : : : : : This message was edited by Phat Nat at 2006-12-12 17:31:50

: : : : : : : : 1. How do I use the mouse in pascal? Im trying to have a program react to the left and right mouse click...
: : : : : : : :
: : : : : : : : 2. Furthermore I am trying to store the information I collect in the way in a txt file. Ive programmed pascal to store keys the program user enters in a .dat file but i expect that this process will have no way of storing which mouse button is clicked just like it cannot store the left or right key stroke but uses an empty space to do this... Is there any way around this?
: : : : : : : :
: : : : : : :
: : : : : : : For storing the Left & Right keystrokes you need to read READKEY twice. The first time will return a "0" (meaning extended function) and the second key will be the real keystroke value (75=Left 77=Right)
: : : : : : : If these values are found, you could store them as characters 27 & 26 (<Left Arrow> & <Right Arrow>) for easier deciphering.
: : : : : : :
: : : : : : : As for the Mouse, if you're using TP7 this will work (as it supports inline assembly). It's not in a unit, but it will get the job done. It will give you the X, Y & Buttons of the mouse.
: : : : : : : Mouse Buttons: Lf=1, Rt=2, Lf&Rt=3, Cn=4, Lf&Cn=5, etc
: : : : : : :
: : : : : : :
: : : : : : : PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte); Assembler;
: : : : : : : ASM
: : : : : : :    Mov Ax, $0003           { Function 3 = Get Mouse X,Y & Buttons }
: : : : : : :    Int $33                 { Int $33 = Mouse Functions }
: : : : : : :    Shr Cx, 1               { Divide MouseX by 2 }
: : : : : : :    Les Di, MouseX          { ES:DI = @MouseX }
: : : : : : :    Mov Es:[Di], Cx         { MouseX is returned as 0-639, I want 0-319 }
: : : : : : :    Les Di, MouseY          { ES:DI = @MouseY }
: : : : : : :    Mov Es:[Di], Dx         { MouseY is returned as 0-199 }
: : : : : : :    Les Di, MouseB          { ES:DI = @MouseB }
: : : : : : :    Mov Es:[Di], Bl         { Mouse Buttons }
: : : : : : : End;
: : : : : : : 

: : : : : : :
: : : : : : : Hope this is what you need.
: : : : : : : Phat Nat
: : : : : : :
: : : : : : : PS - Thought you may want these too:
: : : : : : :
: : : : : : : PROCEDURE ShowMouse; Assembler;
: : : : : : : ASM
: : : : : : :    Mov Ax, $0001      { Function 1 = Show Mouse Cursor }
: : : : : : :    Int $33            { Int $33 = Mouse Functions }
: : : : : : : End;
: : : : : : : 
: : : : : : : PROCEDURE HideMouse; Assembler;
: : : : : : : ASM
: : : : : : :    Mov Ax, $0000      { Function 0 = Hide Mouse Cursor }
: : : : : : :    Int $33            { Int $33 = Mouse Functions }
: : : : : : : End;
: : : : : : : 

: : : : : : :
: : : : : : :
: : : : : : :
: : : : : : :
: : : : : : :
: : : : : : :
: : : : : :
: : : : : :
: : : : : : Hi PhatNat,
: : : : : : thanks for your reply, as always. One question, Im trying to use this procedure in a pascal program:
: : : : : :
: : : : : : PROGRAM Mouze;
: : : : : : USES Crt;
: : : : : :
: : : : : :
: : : : : : PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte); Assembler;
: : : : : : ASM
: : : : : : Mov Ax, $0003 { Function 3 = Get Mouse X,Y & Buttons }
: : : : : : Int $33 { Int $33 = Mouse Functions }
: : : : : : Shr Cx, 1 { Divide MouseX by 2 }
: : : : : : Les Di, MouseX { ES:DI = @MouseX }
: : : : : : Mov Es:[Di], Cx { MouseX is returned as 0-639, I want 0-319 }
: : : : : : Les Di, MouseY { ES:DI = @MouseY }
: : : : : : Mov Es:[Di], Dx { MouseY is returned as 0-199 }
: : : : : : Les Di, MouseB { ES:DI = @MouseB }
: : : : : : Mov Es:[Di], Bl { Mouse Buttons }
: : : : : : End;
: : : : : :
: : : : : : BEGIN
: : : : : : GetMouse;
: : : : : : END.
: : : : : :
: : : : : : When I try to compile this i get "Error 88:"(" Expected. Fro the bit of research i did i gather that not every procedure needs to be followed by a bracket... What should I put in the brackets?
: : : : : :
: : : : : : thx!
: : : : : : NA
: : : : : :
: : : : : The variables to receive the location of the mouse cursor and buttons, i.e.:
: : : : :
: : : : : VAR MouseX, MouseY : Word; VAR MouseB : Byte
: : : : : 

: : : : : as seen in the declaration of the procedure.
: : : : :
: : : : :
: : : :
: : : :
: : : : But I still have no way of knowing what MouseX and MouseY etc are? Simply entering these variables does not get me anywhere. What should I do to avoid this error "Error 88"?
: : : :
: : : : thx so much!
: : : : NA
: : : :
: : : You don't need to enter the variables. These variables are set by the procedure GetMouse(), and hold the location of the mouse. If you want to do something using the mouse position, you can read those variables.
: : : This example shows the mouse coordinates on the screen:
: : :
: : : begin
: : :   repeat
: : :     GetMouse(MouseX, MouseY, MouseB); { Sets the variables }
: : :     GotoXY(1, 1);
: : :     writeln(MouseX, MouseY); { Uses the location }
: : :   until MouseB > 0; { Checks if the user clicks to end the program }
: : : end;
: : : 

: : :
: : :
: :
: : and what type should these variables be? I tried string and integer, both didnt work...:(
: :
: :
: As you can see from this code:
:
: PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte);
: 

: they must be word and byte. Var parameters must be precisely the same as specified in the procedure declaration.
:

"MouseB" only recognized whether or not a mouse button has been pressed. What code will tell me whether someone pushed the LEFT mouse button or the RIGHT one?

Report
Re: Using the Mouse in Pascal Posted by zibadian on 26 Dec 2006 at 2:18 PM
: : : : : : : : This message was edited by Phat Nat at 2006-12-12 17:31:50

: : : : : : : : : 1. How do I use the mouse in pascal? Im trying to have a program react to the left and right mouse click...
: : : : : : : : :
: : : : : : : : : 2. Furthermore I am trying to store the information I collect in the way in a txt file. Ive programmed pascal to store keys the program user enters in a .dat file but i expect that this process will have no way of storing which mouse button is clicked just like it cannot store the left or right key stroke but uses an empty space to do this... Is there any way around this?
: : : : : : : : :
: : : : : : : :
: : : : : : : : For storing the Left & Right keystrokes you need to read READKEY twice. The first time will return a "0" (meaning extended function) and the second key will be the real keystroke value (75=Left 77=Right)
: : : : : : : : If these values are found, you could store them as characters 27 & 26 (<Left Arrow> & <Right Arrow>) for easier deciphering.
: : : : : : : :
: : : : : : : : As for the Mouse, if you're using TP7 this will work (as it supports inline assembly). It's not in a unit, but it will get the job done. It will give you the X, Y & Buttons of the mouse.
: : : : : : : : Mouse Buttons: Lf=1, Rt=2, Lf&Rt=3, Cn=4, Lf&Cn=5, etc
: : : : : : : :
: : : : : : : :
: : : : : : : : PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte); Assembler;
: : : : : : : : ASM
: : : : : : : :    Mov Ax, $0003           { Function 3 = Get Mouse X,Y & Buttons }
: : : : : : : :    Int $33                 { Int $33 = Mouse Functions }
: : : : : : : :    Shr Cx, 1               { Divide MouseX by 2 }
: : : : : : : :    Les Di, MouseX          { ES:DI = @MouseX }
: : : : : : : :    Mov Es:[Di], Cx         { MouseX is returned as 0-639, I want 0-319 }
: : : : : : : :    Les Di, MouseY          { ES:DI = @MouseY }
: : : : : : : :    Mov Es:[Di], Dx         { MouseY is returned as 0-199 }
: : : : : : : :    Les Di, MouseB          { ES:DI = @MouseB }
: : : : : : : :    Mov Es:[Di], Bl         { Mouse Buttons }
: : : : : : : : End;
: : : : : : : : 

: : : : : : : :
: : : : : : : : Hope this is what you need.
: : : : : : : : Phat Nat
: : : : : : : :
: : : : : : : : PS - Thought you may want these too:
: : : : : : : :
: : : : : : : : PROCEDURE ShowMouse; Assembler;
: : : : : : : : ASM
: : : : : : : :    Mov Ax, $0001      { Function 1 = Show Mouse Cursor }
: : : : : : : :    Int $33            { Int $33 = Mouse Functions }
: : : : : : : : End;
: : : : : : : : 
: : : : : : : : PROCEDURE HideMouse; Assembler;
: : : : : : : : ASM
: : : : : : : :    Mov Ax, $0000      { Function 0 = Hide Mouse Cursor }
: : : : : : : :    Int $33            { Int $33 = Mouse Functions }
: : : : : : : : End;
: : : : : : : : 

: : : : : : : :
: : : : : : : :
: : : : : : : :
: : : : : : : :
: : : : : : : :
: : : : : : : :
: : : : : : :
: : : : : : :
: : : : : : : Hi PhatNat,
: : : : : : : thanks for your reply, as always. One question, Im trying to use this procedure in a pascal program:
: : : : : : :
: : : : : : : PROGRAM Mouze;
: : : : : : : USES Crt;
: : : : : : :
: : : : : : :
: : : : : : : PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte); Assembler;
: : : : : : : ASM
: : : : : : : Mov Ax, $0003 { Function 3 = Get Mouse X,Y & Buttons }
: : : : : : : Int $33 { Int $33 = Mouse Functions }
: : : : : : : Shr Cx, 1 { Divide MouseX by 2 }
: : : : : : : Les Di, MouseX { ES:DI = @MouseX }
: : : : : : : Mov Es:[Di], Cx { MouseX is returned as 0-639, I want 0-319 }
: : : : : : : Les Di, MouseY { ES:DI = @MouseY }
: : : : : : : Mov Es:[Di], Dx { MouseY is returned as 0-199 }
: : : : : : : Les Di, MouseB { ES:DI = @MouseB }
: : : : : : : Mov Es:[Di], Bl { Mouse Buttons }
: : : : : : : End;
: : : : : : :
: : : : : : : BEGIN
: : : : : : : GetMouse;
: : : : : : : END.
: : : : : : :
: : : : : : : When I try to compile this i get "Error 88:"(" Expected. Fro the bit of research i did i gather that not every procedure needs to be followed by a bracket... What should I put in the brackets?
: : : : : : :
: : : : : : : thx!
: : : : : : : NA
: : : : : : :
: : : : : : The variables to receive the location of the mouse cursor and buttons, i.e.:
: : : : : :
: : : : : : VAR MouseX, MouseY : Word; VAR MouseB : Byte
: : : : : : 

: : : : : : as seen in the declaration of the procedure.
: : : : : :
: : : : : :
: : : : :
: : : : :
: : : : : But I still have no way of knowing what MouseX and MouseY etc are? Simply entering these variables does not get me anywhere. What should I do to avoid this error "Error 88"?
: : : : :
: : : : : thx so much!
: : : : : NA
: : : : :
: : : : You don't need to enter the variables. These variables are set by the procedure GetMouse(), and hold the location of the mouse. If you want to do something using the mouse position, you can read those variables.
: : : : This example shows the mouse coordinates on the screen:
: : : :
: : : : begin
: : : :   repeat
: : : :     GetMouse(MouseX, MouseY, MouseB); { Sets the variables }
: : : :     GotoXY(1, 1);
: : : :     writeln(MouseX, MouseY); { Uses the location }
: : : :   until MouseB > 0; { Checks if the user clicks to end the program }
: : : : end;
: : : : 

: : : :
: : : :
: : :
: : : and what type should these variables be? I tried string and integer, both didnt work...:(
: : :
: : :
: : As you can see from this code:
: :
: : PROCEDURE GetMouse(VAR MouseX, MouseY : Word; VAR MouseB : Byte);
: : 

: : they must be word and byte. Var parameters must be precisely the same as specified in the procedure declaration.
: :
:
: "MouseB" only recognized whether or not a mouse button has been pressed. What code will tell me whether someone pushed the LEFT mouse button or the RIGHT one?
:
:
Probably by the number returned in the MouseB. Just test it, by showing the results of MouseB on the screen.
Report
Re: Using the Mouse in Pascal Posted by Phat Nat on 28 Dec 2006 at 6:44 PM
: :
:
: "MouseB" only recognized whether or not a mouse button has been pressed. What code will tell me whether someone pushed the LEFT mouse button or the RIGHT one?
:
:

As written before:
: Mouse Buttons: Lf=1, Rt=2, Lf&Rt=3, Cn=4, Lf&Cn=5, etc

The values tell you what button has been pressed. (Although I've found some computers don't recognize pressing the center button in DOS)
If you know binary, basically the Left button is bit 0, the right is bit 1 and the center is bit 2.
MouseB = xxxxxCRL

Phat Nat
Report
Re: Using the Mouse in Pascal Posted by NinthAngle on 29 Dec 2006 at 11:15 AM
: : :
: :
: : "MouseB" only recognized whether or not a mouse button has been pressed. What code will tell me whether someone pushed the LEFT mouse button or the RIGHT one?
: :
: :
:
: As written before:
: : Mouse Buttons: Lf=1, Rt=2, Lf&Rt=3, Cn=4, Lf&Cn=5, etc
:
: The values tell you what button has been pressed. (Although I've found some computers don't recognize pressing the center button in DOS)
: If you know binary, basically the Left button is bit 0, the right is bit 1 and the center is bit 2.
: MouseB = xxxxxCRL
:
: Phat Nat
:


Thanks - i catually figered that one out... One more question: Ive noticed that GetMouse cannot work with MouseB unless MouseX and MouseY are added to its brackets... If they are not there I get a type mismatch. Why is that?

Report
Re: Using the Mouse in Pascal Posted by Phat Nat on 29 Dec 2006 at 1:16 PM
: : : :
: : :
: : : "MouseB" only recognized whether or not a mouse button has been pressed. What code will tell me whether someone pushed the LEFT mouse button or the RIGHT one?
: : :
: : :
: :
: : As written before:
: : : Mouse Buttons: Lf=1, Rt=2, Lf&Rt=3, Cn=4, Lf&Cn=5, etc
: :
: : The values tell you what button has been pressed. (Although I've found some computers don't recognize pressing the center button in DOS)
: : If you know binary, basically the Left button is bit 0, the right is bit 1 and the center is bit 2.
: : MouseB = xxxxxCRL
: :
: : Phat Nat
: :
:
:
: Thanks - i catually figered that one out... One more question: Ive noticed that GetMouse cannot work with MouseB unless MouseX and MouseY are added to its brackets... If they are not there I get a type mismatch. Why is that?

With Pascal, you must assign a variable when a procedure/function has it declared in it's header (Unlike Visual Basic, etc)
If you mean when you remove them from the Procedure declaration, it will give a fault because inside the procedure tries to access MouseX, MouseY. You would need to remove any lines in the procedure relating to MouseX, MouseY
Shr Cx, 1               { Divide MouseX by 2 }
   Les Di, MouseX          { ES:DI = @MouseX }
   Mov Es:[Di], Cx         { MouseX is returned as 0-639, I want 0-319 }
   Les Di, MouseY          { ES:DI = @MouseY }
   Mov Es:[Di], Dx         { MouseY is returned as 0-199 }


Otherwise all you really need to do is:
VAR
   Junk : Word;
   Buttons : Byte;
Begin
     GetMouse(Junk,Junk,Buttons);
End.

This will just throw the results into a junk variable.

Phat Nat



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.