LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 10-05-2005, 09:49 AM   #1
ToothlessRebel
Member
 
Registered: Jun 2004
Location: FL, USA
Distribution: Slackware 9.1
Posts: 190

Rep: Reputation: 30
Wheel Mouse in 10.2


I upgraded to Slack 10.2, and in the process lost the function of my scroll wheel on my mouse!

/etc/X11/XF86Config still has the ZAxisMapping "4 5" line uncommented. Thi is what allowed it to work before. Has the config script name or location changed or something? Is there some new setting in KDE 3.4?

Thanks,
-TR
 
Old 10-05-2005, 10:11 AM   #2
detpenguin
Senior Member
 
Registered: Oct 2003
Location: lost in the midwest...
Distribution: Slackware
Posts: 1,091

Rep: Reputation: 45
this is mine in 10.2 and it works great...is your protocol IMPS/2?

Code:
Section "InputDevice"

# Identifier and driver

    Identifier	"Mouse1"
    Driver	"mouse"
    Option "Buttons" "5"
    Option "ZAxisMapping" "4 5"
    Option "Protocol"    "IMPS/2"
    Option "Device"      "/dev/mouse"
 
Old 10-05-2005, 11:52 AM   #3
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 797

Rep: Reputation: 247Reputation: 247Reputation: 247
What I found is the "ZAxisMapping" must refer to the last two button codes on the mouse whether they happen to be the wheel, or they happen to be buttons.
In my case I have a Microsoft Intellimouse Optical, that has button codes like this.

1 - Left Button
2 - Right Button
3 - Middle Button (press down on wheel)
4 - Wheel Up
5 - Wheel Down
6 - Left Side (thumb)
7 - Right Side

In order for my wheel and all buttons to work I had to do this.

In "/etc/X11/xorg.conf"
Code:
Section "InputDevice"

# Identifier and driver

    Identifier	"Mouse1"
    Driver	"mouse"
    Option "Protocol"    "ExplorerPS/2"
    Option "Device"      "/dev/mouse"
    Option "Buttons" "7"
    Option "ZAxisMapping" "6 7"

#    Option "Emulate3Buttons"
#    Option "Emulate3Timeout"    "50"
As you can see I had to lie to X-Windows and tell it that my wheel was on buttons 6 and 7 (the last two buttons).

To sort things out I had to use the "xmodmap" command to specify the correct button numbers.

In "/etc/xprofile" (which I had to create)

Code:
# X-Windows settings for all types of logins

# Map buttons for Intellimouse
xmodmap -e "pointer = 1 2 3 6 7 4 5"
Each position in the "pointer =" option is a physical mouse button input.
Each number indicates the internal button code that X-Windows should actually use when that physical button is pressed.

The end result is this:

Real Mouse Button ---> X-Windows Button Code
1 --> 1 (left)
2 --> 2 (right)
3 --> 3 (middle)
4 --> 6 (wheel up)
5 --> 7 (wheel down)
6 --> 4 (left side)
7 --> 5 (right side)

From the perspective of X-Windows my mouse looks like this.

1 (left)
2 (right)
3 (middle)
4 (left side)
5 (right side)
6 (wheel up)
7 (wheel down)

If you want your own custom settings for a user login, you can create your own ".xprofile" in your home directory.
Code:
# Map buttons for Intellimouse
xmodmap -e "pointer = 1 2 3 6 7 4 5"
# Mouse button macros
imwheel -k -b "4567"
Above is my ".xprofile" that adds the "imwheel" program to support button macros.

To save yourself a lot of grief, do not try to use ".xinitrc" or ".Xmodmap " or the global versions of those files to specify the mouse button mapping. Those files do not get executed when you use the graphical login window for KDE, and I wasted a lot of time trying to figure out why the mouse wouldn't work right. It turns out that only "/etc/xprofile" or ".xprofile" is executed for ALL types of logins.

If your mouse actually has the wheel using the last two button codes, then you should be able to just use the correct button codes for "ZAxisMapping". For example, if you have a wheel mouse with only Left, Right, and Middle (wheel) buttons, plus the wheel using the last two button codes, you can do this.

In "/etc/X11/xorg.conf"
Code:
Section "InputDevice"

# Identifier and driver

    Identifier	"Mouse1"
    Driver	"mouse"
    Option "Protocol"    "ExplorerPS/2"
    Option "Device"      "/dev/mouse"
    Option "Buttons" "5"
    Option "ZAxisMapping" "4 5"

#    Option "Emulate3Buttons"
#    Option "Emulate3Timeout"    "50"
You don't need to use "xmodmap", since the button codes match those expected by X-Windows.

If you are going to use the "imwheel" program and also have to remap your mouse buttons there are some special considerations. The "imwheel" program wants buttons arranged like this.

1 (left)
2 (right)
3 (middle)
4 Up / Button4 (wheel up)
5 Down / Button5 (wheel down)
6 Left / Button6 (wheel left)
7 Right / Button7 (wheel right)
8 Thumb1 / Button8 (extra button)
9 Thumb2 / Button9 (extra button)

One of the weirder things about "imwheel" is it refers to the buttons coming in with one set of names "Up, Down, etc." and the buttons going out with a different set of names "Button4, Button5, etc.".

As you can see this doesn't match either my mouse, nor X-Windows.
I decided to just think of my left/right side buttons as "wheel left" and "wheel right", since "imwheel" uses the names "left" and "right" to refer to them. However, that meant I could not use the default configuration files provided with "imwheel".

To give "imwheel" the desired mouse button inputs I had to do this.

Part of my ".xprofile" file.
Code:
# Mouse button macros
imwheel -k -b "4567"
There may be other options that work with "imwheel" but I didn't try any more experimenting. If your buttons are arranged in a different order, then you will need to change "4567" to something else.

I had to create my own "default" configuration for "imwheel" to start off with, and then add to the file as needed.

Here is the default ".imwheelrc" file that I put in my home directory.

Code:
# IMWheel Configuration file ($HOME/.imwheelrc or /etc/imwheelrc)
# (GPL)Jon Atkins <jcatki@jonatkins.org>
# Please read the README and/or imwheel(1) manpage for info
# and this is best operated on using vim (as I said: It's crunchy)

#"^Mozilla-bin$"
#,	Up,	Button4
#,	Down,	Button5
#,	Left,	Alt_L|Left
#,	Right,	Alt_L|Right

# Pass through mouse events for everything else
".*"
@Exclude
If I uncomment the definition for "Mozilla" it just maps the wheel buttons in (Up and Down) to the wheel buttons out (Button4 and Button5). That does the equivalent of the "@Exclude" for those button codes. It maps the left side and right side buttons in (Left and Right) to some keycodes (alternate+left arrow) and (alternate+right arrow). Those are the codes for previous page, and next page in the Mozilla browser. Mozilla already understands the mouse button codes, so this is unecessary.

If you wanted to define the equivalent of "@Exclude" just for one application you would do this.

Code:
"^appname$"
,	Up,	Button4
,	Down,	Button5
,	Left,	Button6
,	Right,	Button7
That works, but is unecessary, since not mentioning the application at all uses the "@Exclude" definition that does the same thing. It does give you a better idea of how "imwheel" refers to the buttons coming in from the mouse, and going out to X-Windows.

If you have no left and right buttons, and you want your wheel to change to a left/right wheel when you press either Alt key, you can use this definition.

Code:
"^appname$"

# Alt buttons with wheel scroll left and right
Alt_L,	Up,	Button6
Alt_L,	Down,	Button7
Alt_R,	Up,	Button6
Alt_R,	Down,	Button7
Alt_R|Alt_L,	Up,	Button6
Alt_R|Alt_L,	Down,	Button7
# Any other key combinations, wheel scrolls up and down
,	Up,	Button4
,	Down,	Button5
Unless you expect someone left-handed to use the mouse, you can leave out the "Alt_R" definitions. It's kind of awkward to press the right-hand Alt button and move the mouse wheel. The same goes for "Alt_R|Alt_L", since pressing both Alt buttons and using the mouse is unlikely. The first argument on each line can also be "None" which is not the same thing as leaving it out entirely. Using "None" means no keys pressed. Leaving it out means any key combinations pressed (except for one's already mentioned).

Last edited by Erik_FL; 10-05-2005 at 12:21 PM.
 
Old 10-05-2005, 02:02 PM   #4
ToothlessRebel
Member
 
Registered: Jun 2004
Location: FL, USA
Distribution: Slackware 9.1
Posts: 190

Original Poster
Rep: Reputation: 30
Hmm... yes my protocol is IMPS/2.

Erik, is your information for all applications/installations of X or Slackware 10.2 specificly? I was previously using IMPS/2 and the ZAxisMapping option with buttons 4 and 5 and it worked fine.

I'll double check the format of the option when I get home. Also, Erik is using /etc/X11/xorg.conf for his input device definitions. This file I believe exists on my computer but is not what I refered to, which was /etc/X11/XF86Config.

Thanks
~TR
 
Old 10-05-2005, 02:15 PM   #5
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
Well since Slackware 10.2 uses Xorg instead of Xfree, the configuration file for Xorg is read from /etc/X11/xorg.conf (XF86Config was used by XFree86), so you should enable ZAxisMapping there.
 
Old 10-05-2005, 02:28 PM   #6
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 797

Rep: Reputation: 247Reputation: 247Reputation: 247
The information I posted pertains specifically to Slackware version 10.2, and using a mouse where the wheel codes are not the last two button codes for the mouse.

In order to get my mouse wheel to operate in Slackware version 10.2, I had to edit "/etc/xorg.conf", and not the file you mentioned. Unless that file is symbolically linked to "/etc/xorg.conf" that could be why your mouse wheel doesn't work.

If I remember correctly, there were a number of files with names simlar to "xorg.conf" that appeared to be examples, or initial configurations. Those files did not appear to be used after Linux was installed.

From what I understand, different versions and distributions of Linux handle "ZAxisMapping" in different ways. Some versions of Linux ignore any button numbers higher than the one's listed in "ZAxisMapping", or don't see the buttons listed in "ZAxisMapping" if they aren't the last two buttons.

If you have a mouse wheel that sends button codes 4 and 5, you should be able to make it work by setting the number of buttons to 5, and then putting buttons 4 and 5 in the "ZAxisMapping" option. That's what detpenguin stated.

If you happen to have buttons 6 and 7 on your mouse (as I do) then you won't be able to use those buttons with that configuration, although the wheel will work. Even setting the number of buttons to 7 will not allow buttons 6 and 7 to work (and might make the wheel stop working).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PS2 wheel mouse/wheel not working jayhel Linux - Hardware 2 06-18-2006 06:54 PM
Newbie: Change mouse to wheel mouse (fedore c2) WesleyVH Linux - Newbie 9 10-29-2004 01:36 AM
4d wheel mouse - scroll wheel no worky CamelofCamelot Linux - Hardware 1 10-28-2004 08:33 PM
Cordless Mouse & Mouse Wheel Issues! simsjr Slackware 6 04-22-2004 04:57 PM
Wisetech optical mouse and mouse wheel support bigredgiant1 Linux - Hardware 2 12-31-2003 04:57 AM


All times are GMT -5. The time now is 09:47 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration