View previous topic :: View next topic |
Author |
Message |
Negated Void l33t
Joined: 25 Dec 2002 Posts: 672
|
Posted: Wed Oct 26, 2005 3:51 am Post subject: Calculating mouse movement / distance? |
|
|
Hello!
I'm working on a hardwear project to school, and I was wondering if it's possible to track the location of a mouse (given a known starting location)?
Would you have to account for the fact that a mouse goes farther per inch if it's moving faster than if it's moving slower? or can that be disabled?
How well would this scale? (Could it be done for four mice at once?)
--Murph |
|
Back to top |
|
|
SZwarts l33t
Joined: 13 Oct 2003 Posts: 629 Location: Sydney, NSW, Australia
|
|
Back to top |
|
|
Negated Void l33t
Joined: 25 Dec 2002 Posts: 672
|
Posted: Wed Oct 26, 2005 4:00 am Post subject: |
|
|
Neat!
I'm looking into finding the source, and hopefully finding a way to:
1) Split it into an x,y set of cordinants
2) Not bound it at the edge of the screen - honestly, I'm trying to measure the movement of the mouse - not the cursor.
I'm still interested in any other ideas people here have.
--Murph
PS - The comments in kodometer.cpp are hilarious!
* The point is, since you might have one 17" screen and on 21" screen,
* lets measure them differently. Surely this level of accurasy is
* only provide to prove that the original author was a man's man. |
|
Back to top |
|
|
SZwarts l33t
Joined: 13 Oct 2003 Posts: 629 Location: Sydney, NSW, Australia
|
Posted: Wed Oct 26, 2005 5:17 am Post subject: |
|
|
Negated Void wrote: |
2) Not bound it at the edge of the screen - honestly, I'm trying to measure the movement of the mouse - not the cursor.
|
As far as I know this is resolved at a really early step. This might proof the be a hard thing. Most systems immediately translate it to on screen coordinates. That's why for example first player shooters keep recentering the mouse (invisible) all the time so when the game cycle comes back to that point again you can see how much it has moved.
As far as I know the only possibility to this is do read /dev/mouse (or the positions of your four mouses) and decode the ps/2 protocol. If you do a cat /dev/mouse you can still see stuff coming from it on the screen boundaries.
But I might be wrong... _________________ only when it is dark enough, can you see the stars |
|
Back to top |
|
|
Negated Void l33t
Joined: 25 Dec 2002 Posts: 672
|
Posted: Wed Oct 26, 2005 6:28 am Post subject: |
|
|
I don't need to use the computer while this is happening. I would be fine with resetting the mouse to the center of the screen with every ready of it's location, and setting a waybig resolution.
If i wanted to run four of these at once, Could I? Would I need to run four copies of X? X dosn't seem to register mouse movements when I goto the console (ctrl alt f2)
--Murph |
|
Back to top |
|
|
Negated Void l33t
Joined: 25 Dec 2002 Posts: 672
|
Posted: Wed Oct 26, 2005 6:48 am Post subject: |
|
|
OOooh.. I've also had some luck with: http://floam.sh.nu/files/misc/evtest.c
This gives me the X and Y changes, plus dosn't require X. And it's unbounded. AND i can specify the device node that it connects to (Easily run four mice!)
^-^ Just got to modify it a lil.
[edit] Some playing with that source is giving great results - I've got the X,Y coordinates being outputed, and all the other output squelched. Now to see about finding an appropriate conversion factor from mystery mouse units to something metric.[/edit] |
|
Back to top |
|
|
|