Connecting Tech Pros Worldwide Help | Site Map

Mouse Movement On Linux

  #1  
Old May 6th, 2009, 09:50 AM
Newbie
 
Join Date: Oct 2008
Posts: 13
Hey ,

I wonder how and which programming language I can use to capture movement of a mouse on Linux screen (not just on a particular webpage user is on) like how VB, C#,C++, and J# can be used to detect mouse movement on windows screen.

Thanks in advance
L
  #2  
Old May 20th, 2009, 09:03 PM
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North :)
Posts: 4,940
Provided Answers: 8

re: Mouse Movement On Linux


What are you developing?
What Linux flavour are you using?
What libraries are you using and what language to develop your application?
What have you tried so far to solve your problem?
  #3  
Old May 26th, 2009, 10:01 PM
Nepomuk's Avatar
Moderator
 
Join Date: Aug 2007
Location: Germany
Posts: 2,468

re: Mouse Movement On Linux


I can just run
Expand|Select|Wrap|Line Numbers
  1. sudo cat /dev/psaux
in a terminal and it will react to the mouse - it is a PS/2 mouse of course. Sometimes there's also a generic device /dev/mouse or something like that. Will that do the job?

Greetings,
Nepomuk
  #4  
Old May 28th, 2009, 07:43 AM
ashitpro's Avatar
Expert
 
Join Date: Aug 2007
Posts: 388

re: Mouse Movement On Linux


Quote:
Originally Posted by Nepomuk View Post
I can just run
Expand|Select|Wrap|Line Numbers
  1. sudo cat /dev/psaux
in a terminal and it will react to the mouse - it is a PS/2 mouse of course. Sometimes there's also a generic device /dev/mouse or something like that. Will that do the job?

Greetings,
Nepomuk
/dev/psaux won't work, if you're using latest kernel.
It's been removed from 2.6 kernel..
Correct device is /dev/input/mice.
  #5  
Old June 12th, 2009, 04:18 PM
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,096
Provided Answers: 3

re: Mouse Movement On Linux


If you are familiar with the .NET world, you might look into MONO for linux.
Thing to remember (and it drove me nuts before I found it), attaching even handlers to the mouse move events(signals) is not enough, you actually have to enable the object to have that event (there's a property somewhere).

I am sure there is stuff in Xwindows libraries to deal with mouse as well
  #6  
Old June 12th, 2009, 06:31 PM
drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,521

re: Mouse Movement On Linux


Do NOT use Mono/.NET. It would be a shame to load this boatload of a framework just to look at the mouse and you'll find lots of resistance to do so. In addition, it totally goes against the Unix Philosophy of coding programs.
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hey , I wonder how I could use C/C++ to capture movement of a mouse on Linux screen LurkB answers 11 May 11th, 2009 09:13 AM
capture Mouse Movement on Linux screen LurkB answers 2 May 7th, 2009 11:23 PM
capture Mouse Movement on Linux screen with C# LurkB answers 2 May 6th, 2009 10:16 AM
Interaction with two mouse Michele Diegoli answers 4 July 18th, 2005 09:14 AM