Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Calculating mouse movement / distance?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Negated Void
l33t
l33t


Joined: 25 Dec 2002
Posts: 672

PostPosted: Wed Oct 26, 2005 3:51 am    Post subject: Calculating mouse movement / distance? Reply with quote

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
View user's profile Send private message
SZwarts
l33t
l33t


Joined: 13 Oct 2003
Posts: 629
Location: Sydney, NSW, Australia

PostPosted: Wed Oct 26, 2005 3:54 am    Post subject: Reply with quote

You know about the existance of kodo? if you have kde try to run that it seems to account for the exponetial speed/distance thing
_________________
only when it is dark enough, can you see the stars
Back to top
View user's profile Send private message
Negated Void
l33t
l33t


Joined: 25 Dec 2002
Posts: 672

PostPosted: Wed Oct 26, 2005 4:00 am    Post subject: Reply with quote

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
View user's profile Send private message
SZwarts
l33t
l33t


Joined: 13 Oct 2003
Posts: 629
Location: Sydney, NSW, Australia

PostPosted: Wed Oct 26, 2005 5:17 am    Post subject: Reply with quote

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
View user's profile Send private message
Negated Void
l33t
l33t


Joined: 25 Dec 2002
Posts: 672

PostPosted: Wed Oct 26, 2005 6:28 am    Post subject: Reply with quote

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
View user's profile Send private message
Negated Void
l33t
l33t


Joined: 25 Dec 2002
Posts: 672

PostPosted: Wed Oct 26, 2005 6:48 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum