Scrolling with the Zoom Slider on a Microsoft Natural Ergonomic Desktop 7000 in Ubuntu

Microsoft Natural Ergonomic Desktop 7000

Microsoft Natural Ergonomic Desktop 7000

The keyboard component of the Natural Ergonomic Desktop 7000 has a conveniently placed “zoom” slider in the centre. My desire to utilize this for scrolling web pages in Ubuntu lead me to some Google searching followed by downloading, patching, and compiling evrouter; a utility that allows you to transcode unhandled input events arriving from peripherals into key codes and mouse actions more suitable for applications. The steps described in this post have been tested on Ubuntu 11.04 64bit, if you’re using an earlier version of Ubuntu YMMV.

The initial step is to download and install evrouter. For completeness here’s a copy-paste of my bash history whilst I was fetching, compiling, and installing evrouter(with large swathes of deletions).

1
2
3
4
5
6
7
8
9
cd /var/tmp/
sudo apt-get install git libxtst-dev
git clone https://github.com/larsmagne/evrouter.git
wget https://raw.github.com/gist/754395/872183805da1da0b1d7703b0995dc755f8b815ad/evrouter-0.4_with_key_repeats_option.patch
cd evrouter
patch -p1 <../evrouter-0.4_with_key_repeats_option.patch
./configure
make
sudo make install

To do anything useful evrouter requires privileged access to devices linked to from /dev/input/by-id/. Adding

**REPLACE WITH YOUR ACCOUNT NAME** ALL=NOPASSWD: /usr/bin/evrouter

to the end of your /etc/sudoers file (remember to use visudo) will let your specific user account execute evrouter as root without a password.

We can ask evrouter to query all our connected input devices using

1
sudo evrouter -D /dev/input/by-id/*

Running this with 7000’s wireless dongle plugged in should display some resembling

device 0: /dev/input/by-id/usb-Microsoft_Microsoft®_2.4GHz_Transceiver_V1.0-event-kbd: Microsoft Microsoft® 2.4GHz Transceiver V1.0
device 1: /dev/input/by-id/usb-Microsoft_Microsoft®_2.4GHz_Transceiver_V1.0-event-mouse: Microsoft Microsoft® 2.4GHz Transceiver V1.0
device 2: /dev/input/by-id/usb-Microsoft_Microsoft®_2.4GHz_Transceiver_V1.0-if01-event-mouse: Microsoft Microsoft® 2.4GHz Transceiver V1.0

Contrary to expectation the device that generates zoom sliders events is the event-mouse source

/dev/input/by-id/usb-Microsoft_Microsoft®_2.4GHz_Transceiver_V1.0-event-mouse

All the events arriving from this device can be viewed in real-time using

1
sudo evrouter -d /dev/input/by-id/usb-Microsoft_Microsoft®_2.4GHz_Transceiver_V1.0-event-mouse

which outputs

Window "(null)": # Window title
# Window "(null)": # Resource name
# Window "(null)": # Class name
"Microsoft Microsoft® 2.4GHz Transceiver V1.0" "/dev/input/by-id/usb-Microsoft_Microsoft®_2.4GHz_Transceiver_V1.0-event-mouse" none key/418 "fill this in!"

Window "(null)": # Window title
# Window "(null)": # Resource name
# Window "(null)": # Class name
"Microsoft Microsoft® 2.4GHz Transceiver V1.0" "/dev/input/by-id/usb-Microsoft_Microsoft®_2.4GHz_Transceiver_V1.0-event-mouse" none key/419 "fill this in!"

as we zoom up and down. Given are some lines that we can paste directly into our ~/.evrouterrc config file, changing “fill this in!” to mouse-wheel up and down (XButton/4 and XButton/5)

"Microsoft Microsoft® 2.4GHz Transceiver V1.0" "/dev/input/by-id/usb-Microsoft_Microsoft®_2.4GHz_Transceiver_V1.0-event-mouse" none key/418 "XButton/4"
"Microsoft Microsoft® 2.4GHz Transceiver V1.0" "/dev/input/by-id/usb-Microsoft_Microsoft®_2.4GHz_Transceiver_V1.0-event-mouse" none key/419 "XButton/5"

With the above two lines in ~/.evrouterrc you should be able to start proxying zoom slides into mouse-wheel movements using

1
sudo evrouter -r /dev/input/by-id/usb-Microsoft_Microsoft®_2.4GHz_Transceiver_V1.0-event-mouse

Happy scrolling!

Bookmark and Share

Leave a Reply