The keyboard finally arrived!

I ordered a new keyboard about a year ago, with the modest name Ultimate Hacking Keyboard. A few weeks ago it finally arrived! I thought I should share some of my thoughts and my initial impression along with some configurations. But, first some background to why I ordered a keyboard with a delivery time for about a year.

The search for the perfect keyboard

As a programmer, the keyboard is my primary tool for work. However, keyboards are primarily created for typing text, and when you use a Swedish keyboard that becomes painfully obvious. Most programing languages are created on a US keyboard layout, which means that all special characters are chosen to be easy to access on this layout. So, to the problems with the Swedish layout. The Swedish language have a few extra characters, and to fit them in they choose to shuffel a lot of the special keys around. So for example, to get the, in programming, very common curly bracket, I need to press right alt and 7. This is a move that causes the hand to leave the home row, twist the wrist and do a strange finger combination. And that is not unique, many characters are similar. So I was searching for a keyboard with US-layout where I still can have my Swedish keys. The Ultimate Hacking Keyboard with the extra key-cluster seemed to make this possible, and the promise of a fully programmable keyboard also sounded great. So I ordered it, even with the knowledge of a long delivery time.

First impressions

I had read some reviews so I knew the build quality was top notch, but when I unpacked the keyboard I was still surprised how solid it felt. This was really a different level of build quality then I’m used to for tech stuff. The assembly was quite straight forward, and the getting started guide was easy to follow. I have the palm rests in wood, and I was a little worried that they would feel hard since I’m used to padded palm rests. When I have used the keyboard a bit, the palm rests are great and have a really premium feeling to them. So the overall quality is really good.

Now to the actual typing experience. First, it is a 60% keyboard, so it is lacking the numpad, arrow keys and F-keys. This is intentional, to keep your hands as much on home row and close by as possible. So, for example, you reach the arrow keys using a mod-key and the ijkl keys. This whole setup felt a little weird at the beginning, but the transition have gone smoother than expected. And after I have gotten used to using the mod-key for all the missing keys, it is actually an improvement. I find myself having my hands comfortably on the palm rest for longer period of times, and not lifting my left hand all the time just for basic navigation.

For the actual feeling in the keys, the keyboard is a mechanical keyboard and I opted for the brown switches that are tactile but still not that noisy. This is my first mechanical keyboard, but the keys feel great. However, even though they are the less noisy version there is still a bit of noise, but I don’t feel that it is too noisy and that it is going to be a problem.

Customization and configuration

I read a review by Jamie Zawinski, who dismissed this keyboard since he didn’t like 60% keyboards (which gets you to wonder why he bought it in the first place) and that he expected a Ultimate Hacking Keyboard to be more vim friendly. The second point, is actually valid to some extent, but luckily this can be fixed since the keyboard is programmable. So as a heavy user of VIM-keybindings in all editors I use (if an editor lacks VIM-keybindings, I will not use it), the first thing I did was to duplicate the Esc key to the Mouse modifier key (the key where CapsLock normally is), with the mouse functionality as a secondary role. This means the key acts as Esc when tapped, but still works as mouse modifier when held down. I really dont understand why they put the navigation keys on ijkl, instead of the vim keys hjkl, but I also fixed that both for regular navigation and mouse navigation. I also put pgup and pgdown on the vim half page up/down, since I use that in vim and it also fitted the rest of the keyboard layout better. I have also done some minor adjustments to bind the workspace navigation to the Linux keybinding.

My current keyboard layout

Now, if they just could provide a VIM-keycap patch set for this vim layout everything should be perfect.

Getting Swedish keys

My original plan was to make the keyboard work with the regular Swedish keymap, by simply remap all the keys to fit, then have the Swedish keys on the key cluster addon. That way the keyboard would work out of the box on all computers configured for Swedish. I haven’t got the key cluster yet since it still is under development, so for now I will simply have to use a modifier key to get the Swedish keys. However, a complete remap to fit a regular Swedish keymap is currently not possible since it is not possible to configure the shift layer yet. Luckily there are ways to work around this. My first version was to use a regular US keymap and create macros using the compose key to create the Swedish åäö. I then found that modern Linux have a se+us keymap, where you have a use keyboard and the åäö on regular keys but with the right alt modifier. Using this, I also duplicated the Swedish characters by using the Fn key instead of right alt, to get the modifier on the other and from the hand typing the chars.

Some extra low level os integration

Since my current laptop have different keyboard layout then my UHK, I need to switch between regular se and se+us keymap. But, since I’m lazy I realize that this can be done automatically when the keyboard is plugged in or removed.

So first I created a script to change the keymap changeKeyboard. It is doing a lot of assumptions and should not be considered to be generic in any way. It assumes gnome-shell is used, that you use two keymaps and the order of these keymaps.

#!/bin/bash
if [ "$1" == "0" -o "$1" == "1" ]; then
PID=ps -a| grep gnome-shell| cut -d ' ' -f 2
if [ -z "$PID" ]; then
echo "no gnome-shell found";
exit -1;
fi
QUERY_ENVIRON="$(tr '\0' '\n' < /proc/${PID}/environ | grep "DBUS_SESSION_BUS_ADDRESS" | cut -d "=" -f 2-)"
if [[ "${QUERY_ENVIRON}" != "" ]]; then
export DBUS_SESSION_BUS_ADDRESS="${QUERY_ENVIRON}"
echo "Connected to session:"
echo "DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS}"
else
echo "Could not find dbus session ID in user environment."
exit -2
fi
gdbus call --session --dest org.gnome.Shell \ --object-path /org/gnome/Shell \ --method org.gnome.Shell.Eval \ "imports.ui.status.keyboard.getInputSourceManager().inputSources[$1].activate()"
fi

Then I wasn’t able to get udev to execute this as my user directly by using su, so I wrote a simple wrapper script for this changeKeyboardAsUser

!/bin/sh
su - myuser -c "/home/myuser/bin/changeKeyboard $@"

The final piece is the actual udev rule to execute all of this and change the keyboard when the keyboard is detected, and change it back when removed. The file /usr/lib/udev/rules.d/99-uhk.rules:

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="6122", RUN+="/home/myuser/bin/changeKeyboardAsUser 1" 
SUBSYSTEM=="usb", DEVPATH=="*:1.0", ACTION=="remove", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="6122", RUN+="/home/myuser/bin/changeKeyboardAsUser 0"

I’m no expert in udev rules, so there might be some more elegant way to do this and to avoid the need for the su wrapper script. Anyway, this works find for now, so when I plugin my keyboard I get the correct keymap, and when I remove it I get the keymap matching my laptop.

Conclusion

With everything setup and configured I really feel like this keyboard is going to be great for programing when I have gotten fully accustomed to the US layout and navigation. Oh, and I almost forgot the most important part… it also looks awesome, in bright yellow with a retro led display and a nice 80s vibe.

2 reaktioner till “The keyboard finally arrived!

Kommentera

Fyll i dina uppgifter nedan eller klicka på en ikon för att logga in:

WordPress.com Logo

Du kommenterar med ditt WordPress.com-konto. Logga ut /  Ändra )

Google+-foto

Du kommenterar med ditt Google+-konto. Logga ut /  Ändra )

Twitter-bild

Du kommenterar med ditt Twitter-konto. Logga ut /  Ändra )

Facebook-foto

Du kommenterar med ditt Facebook-konto. Logga ut /  Ändra )

Ansluter till %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.