[Sussex] xev ?

Steven Dobson steve at dobson.org
Sun Mar 12 08:45:17 UTC 2006


John

On Sun, 2006-03-12 at 07:55 +0000, John D. wrote:
> On Saturday 11 March 2006 17:40, Steven Dobson wrote:
> > On Sat, 2006-03-11 at 17:02 +0000, John D. wrote:
> > > This months linux format, has a reply to someone who's asking about
> > > setting up multi button mice.
> >
> > I have my mouse configured that way - but I might take a look at it more
> > closely as I have an extra button that I don't know what to do with yet.
> >
> > > The response to the letter mentions using the command "xev" in a terminal
> > > when the window is active.
> >
> > I know that command, I've been using it for years.
> >
> > > My problem is that I'm getting "command not found" as both user and root.
> > >
> > > Is xev part of some sort of toolkit or similar ?
> >>
> > xev (X Event) is part of the standard X11 set.  I've been around ever
> > since I started playing with X11 - which is a go few years now (must be
> > something like 15).
> >
> > On my Debian system it is installed in /usr/bin/X11 (but you can also
> > get to via /usr/X11R6/bin).  Are either of these in your path?
> Hum? confusion reigns!
> 
> When I look in /usr theres a link to X11R6/bin. I don't always follow the 
> jargon - "in my path" is something I've read but I'm not sure what or how 
> you're refering to it as.

All *nix type systems (inc Linux) have a path (for matter so does
Win32).  The path defines where the system looks for executable files
when you type the command or you click on a icon which is configured
with just the command name.  If you open up a command tool the following
commands report on the path and the files they can find:

$ echo $PATH      <-- Report the current path.
			It is a colon (:) seperated list

$ which <command> <-- Reports the full path of the command that
			will be executed.  After all you could have
			two commands called "same" one in /bin and
			one in /usr/bin.

> If I try (what seems logical to me) cd /usr/X11R6/bin and then issue the xev 
> command, I'm still getting "command not found" as both user and root.

This tells me that /usr/X11R6/bin is NOT in you path.  You have to call
the command explitly (/usr/X11R6/bin/xev) or relativly
(cd /usr/X11R6/bin; ./xev).

To add /usr/X11R6/bin to your path use the following commands:

$ PATH=$PATH:/usr/X11R6/bin
$ export PATH

NOTE: Each shell has its own path.  If you set it like I have above it
will only effect that shell for the time that shell is in existance.

If you look at the file /etc/profile this is often where configuration
like this (that wants to be system wide) is placed.  Well it is on my
Debian systems.

> If the  xev command is for "X event" how do I run it so that it actually waits 
> for that "X event" of me clicking the button(s) to see if the system is 
> getting anything from them (obviously it's seeing input from some of the 
> buttons, but it's the "thumb" button that I was trying to make work.

You don't.  When xev has keyboard & mouse focus it reports on all the X
events it receives.

> The mouse entry in my xorg.conf looks like this
> 
> Section "InputDevice"
>     Identifier "Mouse1"
>     Driver "mouse"
>     Option "Protocol" "ExplorerPS/2"
>     Option "Device" "/dev/mouse"
>     Option "ZAxisMapping" "6 7"
> 
> Now I'm also a little confused as to whether my mouse qualifies as a 5, 6 or 7 
> button mouse. It has the usual 2 main buttons, a thumb button and a clickable 
> scroll wheel - the confusion is whether the clickable wheel is 2 or 3 buttons 
> (like whether it's scroll is 2 buttons i.e. scroll up is 1 and scroll down is 
> the 2nd).

This looks sounds like my mouse - A logictech Cordless MouseMan Wheel.

> Because that would make it either a 5 or 6 button mouse (so maybe the 
> ZAxisMapping should be "5 6" or even "4 5" and not the "6 7" option that the 
> system has auto selected.

The button mappings are as follows:
   Left button:     1 (select)
   Middle Button:   2 (paste)
   Right Button:    3 (menu)
   Wheel forwards:  4 (scroll up)
   Wheel backwards: 5 (scroll down)
   Thumb Button:    6 (dead - not configured)

My mouse device section looks like this:

Section "InputDevice"
        Identifier      "Logitech Cordless MouseMan Wheel Mouse"
        Driver          "mouse"
        Option          "Buttons"               "6"
        Option          "CorePointer"
        Option          "Device"                "/dev/input/mice"
        Option          "Protocol"              "ImPS/2"
        Option          "Emulate3Buttons"       "false"
        Option          "ZAxisMapping"          "4 5"
EndSection

So if you change your ZAxisMapping line to look like mine your while
should scroll the scrollbars.

> Ha! there doesn't even seem to be a man page for xev to see if I could 
> decypher what it might be trying to tell me!

There is on Debian!

Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : http://mailman.lug.org.uk/pipermail/sussex/attachments/20060312/20e0c5c8/attachment.pgp 


More information about the Sussex mailing list