binding extra buttons on linux

Discussion for ET Players

Moderators: Forum moderators, developers

Post Reply
Decade
Posts: 101
Joined: Tue Dec 07, 2004 2:47 pm

binding extra buttons on linux

Post by Decade »

I use linux and I would like to bind some buttons that can't be bound normally, like mouse6 (and if possible the left "win" button on the keyboard). I have tried to use tools like xvkbd to associate mouse6 to a keyboard button, and it works fine (when I press mouse6 I get the associated keyboard button "pressed") but only in the window manager; in ET such tools have no effect. Any suggestions from the linux users in the forum?
Valiz
Posts: 27
Joined: Thu Aug 26, 2004 6:18 am
Location: Finland

Post by Valiz »

Which mouse are you using? I'm using MX1000 with Ubuntu 5.10, and in ET I have mouse4-5 and KP_EQUALS bound for the extra thumb buttons.
Decade
Posts: 101
Joined: Tue Dec 07, 2004 2:47 pm

Post by Decade »

I have an mx310, so there is only 1 extra button that I could bind. How did you do the bindings? Do they work in game with ET?
Valiz
Posts: 27
Joined: Thu Aug 26, 2004 6:18 am
Location: Finland

Post by Valiz »

I think there are a couple of ways to do the bindings, the way you could do it is:
Check that you have the right number of buttons ( 6 in your case ) in the mouse section of your xorg.conf. Then set ZAxisMapping for 5 and 6.

Code: Select all

Option "Buttons" "6"
Option "ZAxisMapping" "5 6"
Create a file called .xmodmap in your home directory. Write

Code: Select all

pointer = 1 2 3 6 4 5
into that file. Then run that file using xmodmap command:

Code: Select all

xmodmap .xmodmap
That's it, now you can bind mouse4 in ET. If you don't want to manually do the xmodmapping every time you restart X, you can insert the xmodmap .xmodmap command into your .xinitrc file.

Hope this helps, it works for me with MX1000 and for a friend of mine with a 4 button mouse similar to MX310.
Decade
Posts: 101
Joined: Tue Dec 07, 2004 2:47 pm

Post by Decade »

Sorry, probably I didn't explain well my problem: I already bound mouse4 and mouse5, using the method you described. What I want to do is to bind my sixth mouse button, which is normally not possible because mouse6 is not a valid key for enemy territory. I know that on windows this can be done by associating a keyboard button (let's say "p") to the mouse button, so that every time you press your sixth button a "p" key press event is sent to the game; so all you have to do is to bind something to "p". On linux this is possible too, but it only works (at least the method I have tried, with xvkbd http://www.linux-gamers.net/modules/wfs ... ticleid=46) in the windows manager, not in the game. Hope this is more clear now. ;)
Valiz
Posts: 27
Joined: Thu Aug 26, 2004 6:18 am
Location: Finland

Post by Valiz »

What keystroke do you get from the thumb button now? (Edited: Ah MX310 has 3 extra buttons...)

One of my thumb buttons gives a keystroke that ET recognizes as KP_EQUALS, maybe you could use that if you wish to use mouse4 and 5. I'll try to find something useful on how to do this.
Valiz
Posts: 27
Joined: Thu Aug 26, 2004 6:18 am
Location: Finland

Post by Valiz »

https://wiki.ubuntu.com/MultimediaKeys This might help you with the Win key.
Decade
Posts: 101
Joined: Tue Dec 07, 2004 2:47 pm

Post by Decade »

Wow thanks you are right, kp_equals corresponds to mouse6 :o
Also, after reading the xmodmap man page I wrote the following file for xmodmap:

Code: Select all

clear mod4
keycode 115 = equal
keycode 116 = slash
which maps = to the left win key, and / to the right key (useful since, with my italian keyboard, the "/" is usually done by pressing shift+7 :shock: ) so I can just bind stuff to "=". :D
Valiz
Posts: 27
Joined: Thu Aug 26, 2004 6:18 am
Location: Finland

Post by Valiz »

Nice to know you got it working. I switched to Linux little over month ago, and I've just started to get the basics :D
Post Reply