Re: Re. Mouse

From: Michele Andreoli (
Date: Fri May 03 2002 - 14:58:36 CEST

On Fri, May 03, 2002 at 09:57:48AM +0200, Gerrit Lammert wrote:
> Hi.
> Talking about mouse... :-)
> Is it possible, to start a script in Linux, by just pressing a
> mouse-button?
> No gpm or other "driver" should be used, just the hardware-signal.
> I like to press a mouse on a non-monitor-maschine and want the linux to
> shutdown itself.
> Any links/hints/help for this?

This is the script:

        while [ 1 ] ; do
        out=`dd if=/dev/mouse bs=3c count=1`
        ... check the $out content ...
        case $out in
        ..... ) execute command

I only know that: the mouse driver send 3 chars to symbolize a
mouse event.

Here is attached a simple C program that read from /dev/mouse.
You only must implement a scancode parsing.


I keep trying to locate a meeting of Quantum Physicists. But everytime
they set a meeting time, the location changes. And vice versa -- Anonymous

To unsubscribe, e-mail:
For additional commands, e-mail:

This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:22 CET