You don’t know how much you need something until you lose it…
A few weeks ago, I revived my six year old acer aspire, and set it as my default computer at home. But, for a year, my only machine had being a nice thinkpad that my employer, www.uady.mx kindly offered me. One of the most useful features on my thinkpad is that next to the up arrow, there are two buttons conveniently configured to go back and forward in the browser.
I don’t know why, but the folks in acer thought that it would be most convenient to have an euro and dollar sign next to the up arrow, which I don’t really use.
So, every time I wanted to go back in chrome, I was disapointed for such a bad choice on my laptop. Being a linux guy, instead of been frustrated, I decided to solve this issue. Here is what I did:
As the arch linux wiki explains [*], there are two concepts to learn first:
- The scancode is the most basic way of identifying a key in linux. This is an hexadecimal code the kernel assigns to each key it recognizes.
- The keycode is analogous to the scancode, but on a higher level. To every scancode there should be a keycode in order for the key to be useful.
Finally, the X server translates those keycodes into symbols that it understand. Some of those symbols are usual characters to be print as text. But there are a few symbols which are special. In my case, the symbols that make the browser go back and forth are named XF86Back and XF86Forward (no surprises here, uh?)
- Figure out the scancode of the buttons next to the up arrow.
- Find out what is the keycode that should assign to XF86(Back/Forward).
For the first task, I just have to open the file located at /usr/lib/udev/keymaps/acer and it contained the info. (It said that in my laptop those special buttons euro, and dollar where bound to the scancodes 0xB3 and 0xB4). I suppose for other machines there should be a simmilar file if udev is installed.