By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,117 Members | 2,093 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,117 IT Pros & Developers. It's quick & easy.

Track Mouse Movement when the cursor is off screen?

P: n/a
I have the opportunity to rescue a project that
uses a mouse to sense the relative position of a machine.
The hardware is built...just needs to be programmed.
Stop snickering!!! I didn't do it...I just gotta fix it.

I need to make some calculations on the measurements
and VB6 is my language.

Yes, the system mouse will corrupt the measurement,
but it's an auditing function and that's acceptable.

Everything I've tried so far requires resetting the
mouse cursor to a known position on the screen at the
start of the machine cycle. That sorta works, but
makes it impossible for the system mouse to take control
long enough to operate the computer.

I need to get rid of the cursor position reset and just
monitor the movement of the mouse...NOT the position of
the cursor on the screen.

The obvious stuff in the API looks at cursor position.
I need mouse movement.

Is there some function that can be inquired
to determine mouse movement since the last query even when
the mouse cursor is stuck on the edge of the screen?

Thanks, mike
Aug 9 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
mike wrote:
I have the opportunity to rescue a project that
uses a mouse to sense the relative position of a machine.
The hardware is built...just needs to be programmed.
Stop snickering!!! I didn't do it...I just gotta fix it.

I need to make some calculations on the measurements
and VB6 is my language.

Yes, the system mouse will corrupt the measurement,
but it's an auditing function and that's acceptable.

Everything I've tried so far requires resetting the
mouse cursor to a known position on the screen at the
start of the machine cycle. That sorta works, but
makes it impossible for the system mouse to take control
long enough to operate the computer.

I need to get rid of the cursor position reset and just
monitor the movement of the mouse...NOT the position of
the cursor on the screen.

The obvious stuff in the API looks at cursor position.
I need mouse movement.

Is there some function that can be inquired
to determine mouse movement since the last query even when
the mouse cursor is stuck on the edge of the screen?

Thanks, mike
Not without disabling the mouse entirely and reading the data directly.
There is no concept of movement outside the workspace area.
This also requires that the "machine" is moving the physical mouse,
meaning the user can't use it.

If it isn't moving the physical mouse, why does it touch the cursor
position?

--
Dean Earley (de*********@icode.co.uk)
i-Catcher Development Team

iCode Systems
Aug 12 '08 #2

P: n/a
Dean Earley wrote:
mike wrote:
>I have the opportunity to rescue a project that
uses a mouse to sense the relative position of a machine.
The hardware is built...just needs to be programmed.
Stop snickering!!! I didn't do it...I just gotta fix it.

I need to make some calculations on the measurements
and VB6 is my language.

Yes, the system mouse will corrupt the measurement,
but it's an auditing function and that's acceptable.

Everything I've tried so far requires resetting the
mouse cursor to a known position on the screen at the
start of the machine cycle. That sorta works, but
makes it impossible for the system mouse to take control
long enough to operate the computer.

I need to get rid of the cursor position reset and just
monitor the movement of the mouse...NOT the position of
the cursor on the screen.

The obvious stuff in the API looks at cursor position.
I need mouse movement.

Is there some function that can be inquired
to determine mouse movement since the last query even when
the mouse cursor is stuck on the edge of the screen?

Thanks, mike

Not without disabling the mouse entirely and reading the data directly.
I don't have a problem with this. What I'd like to do is keep the
system mouse active and have this second mouse disconnected from the
cursor and used for program input only.
There's a whole set of rawinput functions, I just can't figure out how
to use them.
They're in the SDK, but I can't get the SDK to install on my XP system
with visual studio 6. See my other posting on this subject.
All the examples are in C++. I have not discovered a function prototype
that I could use in VB6.

I've found a bunch of questions on the web about rawinput, but no answers
beyond what MS publishes...and there's argument that even that doesn't
work...as published.
I did install visual studio 2008. The SDK is there, but I still don't
know how to use them in Visual Basic. Everything I've done in the past
had a function prototype that I could cut/paste from the API viewer.
And I'd really, really like to avoid the learning curve of dotnet and C++ If
I can do it in vb6.

There is no concept of movement outside the workspace area.
There's a program on sourceforge called "synergy". It senses when the
cursor passes the edge of the screen and moves it onto the screen of
another computer on your network. So, Somebody has a concept of what it
means to move outside the (local)workspace area. The source code is
available, but since I don't understand the nuances of C++
syntax, I can't easily figure out how it works. It's rather complex
with all that network stuff built-in.
This also requires that the "machine" is moving the physical mouse,
meaning the user can't use it.
Two mice. Current mouse driver attaches both mice to the same cursor.
There's a cpnmouse driver that gives you two cursors, but the main mouse
cursor attaches itself to whichever cursor goes with the mouse you're
currently using. That doesn't solve my problem. There's an API that
goes with it. I might be able to use it if I could figure out how
to access it in VB6.
>
If it isn't moving the physical mouse, why does it touch the cursor
position?
Again, two mice. Windows, by default, attaches both mice to the same
cursor.
I want to get relative moves out of the machine mouse, which happens
to be a wireless usb mouse, without affecting
the system cursor attached to the system mouse.

A temporary solution would instruct the user not to touch the system
mouse and let the program monitor the system cursor. Problem is that
if the cursor tries to move outside the screen area, everything grinds
to a halt. If I could still get position data with the cursor mashed
up against the edge of the screen...that would be a temporary kludge.
But monitoring cursor position won't do it. I'd have to monitor mouse
moves...which seems to lead me right back to rawinput.

mike
>
Aug 12 '08 #3

P: n/a
mike wrote:
A temporary solution would instruct the user not to touch the system
mouse and let the program monitor the system cursor. Problem is that
if the cursor tries to move outside the screen area, everything grinds
to a halt. If I could still get position data with the cursor mashed
up against the edge of the screen...that would be a temporary kludge.
But monitoring cursor position won't do it. I'd have to monitor mouse
moves...which seems to lead me right back to rawinput.
Move it to the other side when it gets to an edge?

--
Dean Earley (de*********@icode.co.uk)
i-Catcher Development Team

iCode Systems
Aug 13 '08 #4

P: n/a
Dean Earley wrote:
mike wrote:
>A temporary solution would instruct the user not to touch the system
mouse and let the program monitor the system cursor. Problem is that
if the cursor tries to move outside the screen area, everything grinds
to a halt. If I could still get position data with the cursor mashed
up against the edge of the screen...that would be a temporary kludge.
But monitoring cursor position won't do it. I'd have to monitor mouse
moves...which seems to lead me right back to rawinput.

Move it to the other side when it gets to an edge?
Thanks for the suggestion, but that's not what I came here to ask.
Opportunities to KLUDGE the system abound.
What I asked was how to get raw mouse input in VB6 so the application
could act just like a REAL windows application.
mike
Aug 13 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.