LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-01-2005, 05:27 PM   #1
adam_mccullough
LQ Newbie
 
Registered: Oct 2004
Posts: 14

Rep: Reputation: 0
Mouse interface control


Is there any simple/standard way to control the mouse pointer from userspace in Linux? As part of my final year project at uni, I'm developing a camera-driven gaze tracking interface that I'm hoping to demonstrate by using it to position the mouse pointer on the screen. With any luck (and permission from the department) it'll eventually be released under the GPL for accessibility applications, game control etc. Google is not my friend today. Any suggestions?
 
Old 05-01-2005, 06:42 PM   #2
michaelsanford
Member
 
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468

Rep: Reputation: 30
Just a thought (if you're going to go the X11 route) but you might be able to write a custom pointer driver and then load that as the X11 "mouse".
 
Old 05-01-2005, 10:28 PM   #3
adam_mccullough
LQ Newbie
 
Registered: Oct 2004
Posts: 14

Original Poster
Rep: Reputation: 0
I'll only be needing support for X initially, yes.

The docs on writing drivers for X make it seem like quite a bit of work. Apparently, although you do have (wrapped) access to some standard lib calls, there are a lot of restrictions, which is the way it should be I suppose. Having discovered the joys of coding kernel modules a few months back, I'd really rather avoid more frustration with a similar system.

At the minute, I'm looking at using a daemon to run a named fifo with a standard mouse/touchscreen protocol and add it to the core events list that X watches for pointer input. Another fifo or other ipc interface would let my (GUI) vision/tracking system tell the daemon what to tell X. I think it should work pretty nicely (and with minimum coder stress!), but it seems a clumsy way to do it.

The reason for the daemon loop is that, as far as I can tell, my input system would have to be running when X starts up. This might be an assumption - my laptop uses the trackpoint and an external usb mouse. Until I started using udev, X would only pick up the usb mouse if it was plugged in before X started/restarted - if I plugged it in with X running, I'd have to restart X to get it working. Since the machine I'm testing my system on runs a 2.4 kernel, I assume that if I fire up my software and start talking to the input fifo after X has loaded, it will ignore the pointer input. Hopefully I can get around this by running the daemon to keep X interested while it starts up, then start my tracking software and feed the input to X through the daemon.

Am I right in thinking that X will ignore the fifo if it's dead on startup?

Also, finding good documentation for these protocols is proving difficult, since I'm not even sure which one I want to use. It needs abslute positioning, so I guess touchscreens are the thing to investigate...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouse Control... grilledsalad Linux - Newbie 1 12-31-2004 10:55 AM
kernel 2.6.3 mouse interface? rmanocha Linux - Software 4 03-16-2004 11:05 AM
lose control of mouse Zvezda Linux - General 10 03-15-2003 02:33 PM
Loss of Mouse Control Roy-Svork Linux - General 4 01-09-2003 08:48 AM
Losing Mouse control Epsdel Linux - Newbie 3 03-29-2001 04:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration