Operating System - HP-UX
1832273 Members
2183 Online
110041 Solutions
New Discussion

Open /dev/ps2mouse; get "Device busy"

 
Herbert Simon
Advisor

Open /dev/ps2mouse; get "Device busy"

Hi Folks!
I want to know when somebody use the mouse or Keyboard. My Idea was to read the device /dev/ps2mouse with a little C-Programm and take my action if i get a byte from the filediscriptor. On Linux it works fine, but on HP i get only a "Device busy" if i open ( O_RDONLY ) the devicefile.
How to get simply keyboard/mouse events???

Thanks for Help; Mail please to
karsten.kankowski@airbus.com
2 REPLIES 2
Gregory Fruth
Esteemed Contributor

Re: Open /dev/ps2mouse; get "Device busy"

Have you checked out the man page for
ps2mouse? It's quite detailed...

Are you trying to do this while X is running?
If so, perhaps the X server is taking over the
mouse such that you can't get low level
access to it.

Mark Greene_1
Honored Contributor

Re: Open /dev/ps2mouse; get "Device busy"

Have you tried running fuser against it? It should return the PID of the process using it.

HTH
mark
the future will be a lot like now, only later