Enabling scrolling using the Microsoft Natural Ergonomic Keyboard 4000's zoom slider on Ubuntu 12.10
For the past two years, I have been using the excellent Microsoft Natural Ergonomic Keyboard 4000 almost exclusively. This keyboard has a zoom slider in between the two main keys section that I just never use. I don't understand what the reasoning behind having a zoom slider instead of a vertical slider, but today we'll fix that for Ubuntu*.
The easy way
Open the
/lib/udev/rules.d/95-keymap.rulesfile:$ sudo nano /lib/udev/rules.d/95-keymap.rulesLet's find the line that starts with
ENV{ID_VENDOR}=="Microsoft". On my setup, it looks like:ENV{ID_VENDOR}=="Microsoft", ENV{ID_MODEL_ID}=="00db", RUN+="keymap $name 0xc022d zoomin 0xc022e zoomout"Replace the
zoominvalue withpageupand thezoomoutvalue withpagedown:ENV{ID_VENDOR}=="Microsoft", ENV{ID_MODEL_ID}=="00db", RUN+="keymap $name 0xc022d pageup 0xc022e pagedown"After restarting your computer, the changes should be applied.
Fallback
If the above steps don't work, there's always the slightly messier way:
Install
evtest$ sudo apt-get install evtestWe need to manually determine, which input event correspond to our keyboard's slider keys. For this, we will need to iterate the following command:
$ sudo evtest /dev/input/event0- This will run the listener application.
We will press the slider keys until we get any type of response text. Mine looks like:
Event: time 1352080012.017919, type 4 (EV_MSC), code 4 (MSC_SCAN), value c022d Event: time 1352080012.017924, type 1 (EV_KEY), code 104 (KEY_PAGEUP), value 1 Event: time 1352080012.017948, -------------- SYN_REPORT ------------ ^[[5~Event: time 1352080012.185892, type 4 (EV_MSC), code 4 (MSC_SCAN), value c022d Event: time 1352080012.185894, type 1 (EV_KEY), code 104 (KEY_PAGEUP), value 0 Event: time 1352080012.185901, -------------- SYN_REPORT ------------- If nothing happens with
event0, you need to closeevtestand iterate trying different events (event1,event2, etc.) until we get a response. Mine worked with/dev/input/event3.
Let's grab the keys' scan codes:
sudo /lib/udev/keymap -i input/event3Press the slider keys to grab their key codes:
scan code: 0xC022D key code: zoomin scan code: 0xC022E key code: zoomout
With the appropiate event in hand, we create a custom mapping file:
$ sudo nano /lib/udev/keymaps/microsoft-keyboard-4000- Save and close the file (Ctrl+X, Y).
Fill its content with the appropiate mappings:
0xC022D pageup 0xC022E pagedown
- A complete list of available keymaps can be found here.
Test the setup with:
sudo /lib/udev/keymap input/event5 /lib/udev/keymaps/microsoft-keyboard-4000If everything went as expected, the final step is to permanently apply the change. For this we open the keymap rules file:
sudo nano /lib/udev/rules.d/95-keymap.rulesRight before the
GOTO="keyboard_end"line, we'll place the following:ENV{ID_VENDOR_ID}=="045e", ENV{ID_MODEL_ID}=="00db", RUN+="keymap $name microsoft-keyboard-4000"- Save and close the file (Ctrl+X, Y).
After restarting your computer, the changes should be applied.
* Heads up! This tip has been tested on Ubuntu 12.10.
blog comments powered by Disqus
