Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old May 26th, 2007   #1
daou
Extra Foam Sugar Free Ubuntu
 
daou's Avatar
 
Join Date: Jun 2006
Location: Finland
Beans: 797
Ubuntu Jaunty Jackalope (testing)
btnx: Send keyboard and mouse combination events with mouse buttons

If you find this tool useful, please help others use it by translating it into another language: btnx-config @ Launchpad.

Latest versions:btnx (Button Extension) is a daemon that enables rerouting of mouse button events through uinput as keyboard and other mouse button combinations. For example, you can configure an extra mouse button to send a Ctrl+Alt+Right command to switch workspaces. You can also configure buttons to execute commands. This is especially useful for mice with more buttons than Gnome or KDE can properly handle, or mice that need evdev and a 100 step howto to register button events at all.

btnx-config is GUI for detecting and configuring your mouse. You must use btnx-config with btnx. btnx integrates revoco functionality for MX Revolution users, which is editable from btnx-config.

btnx should work with almost any mouse that is configured properly.

The btnx manual is available at: http://www.ollisalonen.com/btnx/man
btnx is known to work on:
  • (K)Ubuntu 7.04
  • (K)Ubuntu 7.10
  • (K)Ubuntu 8.04
Note: Users with an MX or VX Revolution: if you have problems with the thumb buttons, refer to the btnx manual's troubleshooting section 12.2.1 for better xorg.conf values.

Report bugs at Launchpad:
SVN repositories :
-------------------------------------------------------------------------------------------------

Installation:

You have two options. Either install (1) binary packages with apt-get or (2) compile from source.

Note: If you have used another howto to configure your mouse, try to revert as much of the changes you have done.


1. Binary packages:

Note: KDE (Kubuntu) users should compile from source if you want to avoid installing lots of standard Gnome libraries.

1. Put the following lines to the end of your /etc/apt/sources.list file, but replace DISTRO with the name of the Ubuntu distro you have installed (options: feisty gutsy hardy):

Code:
deb http://ppa.launchpad.net/daou/ubuntu DISTRO main
deb-src http://ppa.launchpad.net/daou/ubuntu DISTRO main

2. Now, run the following commands to install btnx and btnx-config:

Code:
$ sudo apt-get update && sudo apt-get install btnx
3. Run btnx-config from Applications->System tools->btnx and refer to the manual as necessary.

2. (Optional) Compile from source

1. Get all the necessary dependencies. btnx-config needs libgtk2.0 and libgtk2.0-dev (version 2.10.11 or newer), libglade and libglade-dev (version 2.6.0 or newer), pkg-config (0.21 or newer), and build-essential. btnx needs build-essential and libdaemon.
Code:
sudo apt-get install build-essential libgtk2.0-0 libgtk2.0-dev libglade2-0 libglade2-dev pkg-config libdaemon0 libdaemon-dev
2. Install btnx
Code:
$ wget http://www.ollisalonen.com/btnx/btnx-0.4.11.tar.gz
$ tar -xvvf btnx-0.4.11.tar.gz
$ cd btnx-0.4.11
$ ./configure
$ make
$ sudo make install
3. Install btnx-config.
Code:
$ wget http://www.ollisalonen.com/btnx/btnx-config-0.4.9.tar.gz
$ tar -xvvf btnx-config-0.4.9.tar.gz
$ cd btnx-config-0.4.9
$ ./configure
$ make
$ sudo make install
If you encountered an error, there is probably a dependency problem.

4. You should have gotten a menu item. In GNOME, Applications->System tools->btnx. In KDE, System->btnx. Press it to launch btnx-config.

You can find all the necessary information for configuring your mouse with btnx-config in the btnx manual. Either press the "Help" button in btnx-config or refer to the online manual at http://www.ollisalonen.com/btnx/man


--------------------------------------------------------------------------------------------------

Uninstall

Binary packages:

Run
Code:
$sudo apt-get remove btnx btnx-config

Compiled source:

To uninstall btnx and btnx-config, run
Code:
$ sudo make uninstall
in the same directory as where you ran the "sudo make install" command for both programs.

--------------------------------------------------------------------------------------------------

Troubleshooting


Please refer to the troubleshooting section in the btnx manual: http://www.ollisalonen.com/btnx/man

It contains answers to frequent problems and good reference values for your xorg.conf file.

NOTE: If some of your mouse buttons send multiple events (like extra middle, right, or left clicks) then refer to the
manual's troubleshooting section on editing you xorg.conf InputSection. Follow it closely!

If your problem persists, post it on this thread.

--------------------------------------------------------------------------------------------------

Useful key combos

blazoner posted a list of some useful keyboard combinations to use with btnx. Look here.

--------------------------------------------------------------------------------------------------

If you feel that btnx or extra mouse button control is an important issue, don't forget to let your vote and voice be heard over at Brainstorm:

__________________
echo -e "\x6f\x61\x73\x61\x6c\x6f\x6e\x65\x6e\x40\x67 \b\x6d\x61\x69\x6c\x2e\x63\x6f\x6d"
It compiles! Ship it!

Last edited by daou; May 2nd, 2008 at 06:53 AM..
daou is offline   Reply With Quote
Old May 28th, 2007   #2
daou
Extra Foam Sugar Free Ubuntu
 
daou's Avatar
 
Join Date: Jun 2006
Location: Finland
Beans: 797
Ubuntu Jaunty Jackalope (testing)
Re: btnx: Send keyboard and mouse combination events with mouse buttons

btnx discussion has been moved here from the MX Revolution howto.

Quote:
you got my vote to get btnx in kubuntu gutsy as a standard once it comes out - Mack1
Thanks . But I think btnx will need to support a few more mice before that will come into consideration.

MX-510 will be added later today. Thanks to sjust for the hexdumping.

Quote:
I just bought an MX Revolution today, and I can't seem to get btnx to make any difference whatsoever...
Maybe I'm doing something wrong...? - Bedpan.ca
Are you running the latest version (at this time 0.2.3)? If you are, did you change the default configurations? If you did, try copying the mx revolution defaults over the btnx_config file:

Code:
$ sudo cp /etc/btnx/defaults/default_config_mxrevo /etc/btnx/btnx_config
$ sudo /etc/init.d/btnx restart
If it still doesn't work try stopping btnx and running it as a foreground process on the command line. This way you can see any error output.

Code:
$ sudo /etc/init.d/btnx stop
$ sudo /usr/sbin/btnx
Tell me what happens.
__________________
echo -e "\x6f\x61\x73\x61\x6c\x6f\x6e\x65\x6e\x40\x67 \b\x6d\x61\x69\x6c\x2e\x63\x6f\x6d"
It compiles! Ship it!

Last edited by daou; May 28th, 2007 at 01:39 AM..
daou is offline   Reply With Quote
Old May 28th, 2007   #3
daou
Extra Foam Sugar Free Ubuntu
 
daou's Avatar
 
Join Date: Jun 2006
Location: Finland
Beans: 797
Ubuntu Jaunty Jackalope (testing)
Re: btnx: Send keyboard and mouse combination events with mouse buttons

Support added for Logitech MX-510 in version 0.2.4. Thanks to sjust for submitting the hexdumps.

sjust: If you already configured Ubuntu to use the extra buttons on your MX-510 with, for example, detyabozhye's guide, you should probably disable the settings so you won't get duplicate events. btnx cannot stop any events from happening that X already handles. This is not a must, you can try running btnx with the old settings intact.
__________________
echo -e "\x6f\x61\x73\x61\x6c\x6f\x6e\x65\x6e\x40\x67 \b\x6d\x61\x69\x6c\x2e\x63\x6f\x6d"
It compiles! Ship it!

Last edited by daou; May 28th, 2007 at 11:40 AM..
daou is offline   Reply With Quote
Old May 28th, 2007   #4
sjust
5 Cups of Ubuntu
 
sjust's Avatar
 
Join Date: Jun 2006
Location: Campbellsburg, KY USA
Beans: 28
Ubuntu 7.10 Gutsy Gibbon
Re: btnx: Send keyboard and mouse combination events with mouse buttons

I am glad I did everything right, and it helped. yes I have used his guide to configure my mouse. I will disable what I can remember and give btnx a shot. I will post back with the resualts
__________________
Sjust
UBUNTU Hardy AMD 64 x2 5000+ 2 GB Memory
Nvidia 8500gt OSS v4
registered Linux user #421719 Ubuntu user #7719
sjust is offline   Reply With Quote
Old May 28th, 2007   #5
Bedpan.ca
5 Cups of Ubuntu
 
Join Date: Apr 2007
Beans: 16
Kubuntu 9.04 Jaunty Jackalope
Re: btnx: Send keyboard and mouse combination events with mouse buttons

Quote:
Originally Posted by daou View Post
Tell me what happens.
Did what you said, and still no dice.
When ran as a foreground process, it says "No startup errors".
Tried the latest 0.2.4 just in case something was different, but again, the mouse does nothing other than the default mousey functions (plus scroll wheel and the stupid backwards sideways scroll wheel tilt).

I'm running 64bit Feisty.
Bedpan.ca is offline   Reply With Quote
Old May 29th, 2007   #6
daou
Extra Foam Sugar Free Ubuntu
 
daou's Avatar
 
Join Date: Jun 2006
Location: Finland
Beans: 797
Ubuntu Jaunty Jackalope (testing)
Re: btnx: Send keyboard and mouse combination events with mouse buttons

Quote:
I'm running 64bit Feisty.
This could be a problem because btnx looks at raw data streams that are likely bitsize-dependent.

If you have the time, could you do the part "How to get support for mouse X?". If it turns out that the stream lengths are just a little different for 64-bit streams, I can easily add support for 64-bit systtems. EDIT: not necessary anymore.

If not, then it gets more difficult.
__________________
echo -e "\x6f\x61\x73\x61\x6c\x6f\x6e\x65\x6e\x40\x67 \b\x6d\x61\x69\x6c\x2e\x63\x6f\x6d"
It compiles! Ship it!

Last edited by daou; May 29th, 2007 at 01:07 PM..
daou is offline   Reply With Quote
Old May 29th, 2007   #7
daou
Extra Foam Sugar Free Ubuntu
 
daou's Avatar
 
Join Date: Jun 2006
Location: Finland
Beans: 797
Ubuntu Jaunty Jackalope (testing)
Re: btnx: Send keyboard and mouse combination events with mouse buttons

Quote:
I'm running 64bit Feisty.
btnx-0.2.5 adds support for 64-bit versions. Installed the AMD64 version on a different partition and looked at the event handlers. As I suspected, the amount of data going to the event handlers during each event grew by 16 bytes. btnx now uses a better algorithm to calculate the rawcodes which is bit-independent.
__________________
echo -e "\x6f\x61\x73\x61\x6c\x6f\x6e\x65\x6e\x40\x67 \b\x6d\x61\x69\x6c\x2e\x63\x6f\x6d"
It compiles! Ship it!
daou is offline   Reply With Quote
Old May 29th, 2007   #8
Bedpan.ca
5 Cups of Ubuntu
 
Join Date: Apr 2007
Beans: 16
Kubuntu 9.04 Jaunty Jackalope
Talking Re: btnx: Send keyboard and mouse combination events with mouse buttons

Quote:
Originally Posted by daou View Post
btnx-0.2.5 adds support for 64-bit versions.
Freaking. Awesome.
You are now my hero as well.
Sweet deals.
Bedpan.ca is offline   Reply With Quote
Old May 30th, 2007   #9
Bedpan.ca
5 Cups of Ubuntu
 
Join Date: Apr 2007
Beans: 16
Kubuntu 9.04 Jaunty Jackalope
Re: btnx: Send keyboard and mouse combination events with mouse buttons

Okay. This one is weird. I've noticed that if I have Konsole open, my mouse will sometime TYPE on its own a capital letter C.
The same is done when scrolling right (left is D).

Also, sometimes if I'm browsing with firefox, the page will sometimes jump backwards in history by itself.

Not sure if this is because of btnx, or a faulty mouse.

Ideas?
Bedpan.ca is offline   Reply With Quote
Old May 30th, 2007   #10
daou
Extra Foam Sugar Free Ubuntu
 
daou's Avatar
 
Join Date: Jun 2006
Location: Finland
Beans: 797
Ubuntu Jaunty Jackalope (testing)
Re: btnx: Send keyboard and mouse combination events with mouse buttons

Quote:
Okay. This one is weird. I've noticed that if I have Konsole open, my mouse will sometime TYPE on its own a capital letter C.
The same is done when scrolling right (left is D).

Also, sometimes if I'm browsing with firefox, the page will sometimes jump backwards in history by itself.

Not sure if this is because of btnx, or a faulty mouse.
Not a faulty mouse. It sounds like btnx is just doing its magic. If you haven't changed btnx's default configuration for MX Revo mice, pressing the top wheel left and right sends ALT+LEFT and ALT+RIGHT signals. In Firefox it goes back and forward in page history. In a terminal, it outputs a C and D.

It's quite easy to accidentally press the wheel sideways when trying to scroll up and down on the MX Revo. It took me a while to get used to it. Don't use any force when scrolling the MX Revo wheel. It's meant to be touched lightly. It's not a normal, crude mouse wheel, after all .

If it seems annoying, you can disable the wheel tilts from doing anything in the btnx_config file by commenting it's button section out.
__________________
echo -e "\x6f\x61\x73\x61\x6c\x6f\x6e\x65\x6e\x40\x67 \b\x6d\x61\x69\x6c\x2e\x63\x6f\x6d"
It compiles! Ship it!
daou is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:32 PM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry