🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #3965

Re: Moving Cursor under Program Control?

#3965
From: Nick Gessler
Date: Sat, 08 Apr 2006 21:03
41 lines
2301 bytes
JD,

Yes, this is exactly what I had in mind. As a quick test,
I coded the following:

void __fastcall TForm1::FormMouseMove(TObject *Sender, TShiftState Shift,
      int X, int Y)
{
   Form1->Canvas->Pixels[X][Y] = clBlack;
   if (X <= 10) {
      SetCursorPos(Form1->Left + Form1->Width,
      Y + Form1->Top);
   }
   if (Y <= 10) {
      SetCursorPos(X + Form1->Left,
      Form1->Top + Form1->Height);
   }
   // yes, more "if"s are needed for bottom and right...
}

I know it's not quite what you suggested. I will have to keep
the cursor in the center of the Form as you wrote.  But this
does show that it will work.

Interesting that the cursor position is in global screen
coordinates while the mouse move is in Form coordinates.  So
one has to compensate for the position of the form.  And for 
the height of the top banner (which I have not done yet).  And
interesting that to get to the close icon one must "sneak" off
of the Form window...

Is there any way I can speed up the mouse sample rate or keep 
it constant?  That is, I don't want to let it accelerate.  It 
would also be useful to associate the mouse move events with
the system clock, which I assume I can do in the standard way.

Yes, this has possibilities...

Many thanks,
Nick
Technical Details
Message-ID: <4438251b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4435c27b$1@newsgroups.borland.com> <4436a479$1@newsgroups.borland.com> <4436e650$1@newsgroups.borland.com> <44370981$1@newsgroups.borland.com> <4437fa99$1@newsgroups.borland.com> <44380995$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,40f8797b34d0291f
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Nick Gessler" <gessler@ucla.edu>
Sender: "Nick Gessler" <gessler@ucla.edu>
Reply-To: "Nick Gessler" <gessler@ucla.edu>
Subject: Re: Moving Cursor under Program Control?
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 71.104.221.42     
References: <4435c27b$1@newsgroups.borland.com> <4436a479$1@newsgroups.borland.com> <4436e650$1@newsgroups.borland.com> <44370981$1@newsgroups.borland.com> <4437fa99$1@newsgroups.borland.com> <44380995$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <4438251b$1@newsgroups.borland.com>
Date: 8 Apr 2006 14:03:23 -0700
X-Trace: newsgroups.borland.com 1144530203 207.105.83.66 (8 Apr 2006 14:03:23 -0700)
Lines: 41
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail