George Gallen on 2 Feb 2005 22:44:21 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

RE: [PLUG] perl and mouses (a how do you do that ?)


Title: RE: [PLUG] perl and mouses (a how do you do that ?)

OK. It looks like I just need to open "/dev/mouse"

On a quick test, however, I needed root permission, but for what I'm
  doing, that's not a problem to give other permission. This is a very
  controlled situation, so I'm not concerned about the security aspects
  of allowing other access to this device.

/dev/mouse on my work system is a pointer to /dev/psaux. Now to play
with this to decode the data from the mouse, which looks straightforward.

Now what should be interesting to see is if I plug a USB mouse in,
Will the system continue to use /dev/psaux as it's mouse, and allow
the /dev/usb/... whatever to be used.

Now I will need to buy a cheap USB mouse, no need for a scroll wheel for
this job

George

>-----Original Message-----
>From: plug-bounces@lists.phillylinux.org
>[mailto:plug-bounces@lists.phillylinux.org]On Behalf Of George Gallen
>Sent: Wednesday, February 02, 2005 2:41 PM
>To: PLUG
>Subject: [PLUG] perl and mouses (a how do you do that ?)
>
>
>ok. here is a question for the perl xperts here...
>
>I need to write a routine that scans the mouse, and writes to
>a file when either
>  the right or left mouse button is clicked, it needs to log,
>which button and the epoc.
>  that is all it's function will be. Looping waiting, logging.
>
>The logging is no problem, getting the epoc is no problem.
>
>I just don't know how to scan the mouse button? Which modules,
>what device, how
>  would I determine the button clicks?
>
>Ultimately, I'm writing a second program that will run and
>it's actions will be determined
>   by the mouse clicks, but not in real-time, that's why they
>need to be logged.
>
>The reason I chose the mouse, is I need a way to wire a
>momentary switch to the PC,
>   so, I'm going to hack a mouse, and put this switch in
>series with the mouse, doing
>   it this way gives me the benefit of having 2 switches for
>expansion of the project, and
>   already having the wiring, drivers done to read the
>switches, and the switches can be
>   hooked up USB.
>
>Speaking of USB, what happens when two mice are hooked up to a
>USB, do both work?
>   or can I read from each one? hmmm.
>
>George
>
>George Gallen
>Senior Programmer/Analyst
>Accounting/Data Division
>ggallen@slackinc.com
>ph:856.848.1000 Ext 220
>
>SLACK Incorporated - An innovative information, education and
>management company
>http://www.slackinc.com
>
>_______________________________________________________________
>____________
>Philadelphia Linux Users Group         --       
>http://www.phillylinux.org
>Announcements -
>http://lists.phillylinux.org/mailman/listinfo/plug-announce
>General Discussion  --  
>http://lists.phillylinux.org/mailman/listinfo/plu>g
>

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug