Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Newbie question, Mouse unit

11 views
Skip to first unread message

Damo Royce

unread,
Mar 10, 2004, 6:16:11 AM3/10/04
to
Hi, I'm new to programming, I'm writing my first program with mouse
input,
but I can't get it to work.
Even the following code does nothing:


Program Example2;

{ Program to demonstrate the GetMouseButtons function. }

Uses mouse;

begin
InitMouse;
Writeln('Press right mouse button to exit program');
While (GetMouseButtons<>MouseRightButton) do
begin
gotoxy(1,1);
write(getmousex,',',getmousey);
end;
DoneMouse;
end.


No matter how much I move the mouse or click the right button, the
mouse cursor
position is displayed as 0,0 and the program won't end.
I am using Free Pascal for w32, my os is winxp.
It makes no difference whether I run it in a window or full screen,
the cursor
is visible and moves, in both, but the program doesn't seem to
acknowledge the
mouse.
The DetectMouse function tells me I have a 3 buttoned mouse which is
correct.

I am sure the solution must be something extremely simple, but I have
no idea
what it is.
I'm stuck. Please, give me some help.

0 new messages