Re: Re. Mouse / typo

From: Alfie Costa (
Date: Mon May 06 2002 - 01:13:10 CEST

On 3 May 2002, at 14:58, Michele Andreoli <> wrote:

> out=`dd if=/dev/mouse bs=3c count=1`

"bs=3c"? 3c hex = 60 dec. 3c is 57 chars too many. Fix:

        out=`dd if=/dev/mouse bs=3 count=1`

More notes...

/dev/mouse also captures mouse movements.

The above method of assigning the shell variable $out loses any nulls.

'dd' outputs unwanted stuff to stderr.

Attached is a variant of your script. It uses 'hexd' to show the output from

# A variant of Michele's mouse output routine. -AC Sun May 5 19:00 EDT 2002
# Requires the muLinux 'hexd' util.

export hexd="hexd -x" # dump hex with no comments or counter

echo " Move the mouse and press the mouse keys."
echo " The hex numbers are from /dev/mouse, taken 3 at a time."
echo " Press <Ctrl-C> to quit."

while [ 1 ] ; do
        out=`dd if=/dev/mouse bs=3 count=1 2> /dev/null | $hexd`
        echo "$out" # show what the mouse saw

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