lego (12) Linux (39) pi (20) Thinkpads (4)

Thursday, 5 December 2013

ThinkPad keyboard overlay for non-ThinkPads [day 2 of 20-days-of-posts series]

Yesterday I discussed a workaround in Linux to remap keyboard keys to mouse buttons to cope with a trackpad (  Today I demonstrate a ThinkPad keyboard overlay that I created for my Ultrabook.

Like with most of my lego projects, I don't provide full schematics and block lists.  My opinion is that if you have unused lego that you can use for a project like this, you make use of what you have, improvising as you go.

Tired with an ultrabook's trackpad, especially with failing trackpad buttons, I decided it was time to finally re-purpose a spare ThinkPad keyboard.

The keyboard I've used is from a old ThinkPad X30.  I needed a keyboard to USB converter.  I happen to have an old USB trackpad keyboard that I wasn't using anymore.  The keyboard has a host board that hooks up to a "standard ThinkPad" keyboard (at that time being any X20/T20/R20/R30 etc), along with a numeric keypad and trackpad.  I'm only going to use the keyboard component.

The controller board in the keyboard case also included a bunch of non-conductive foil that protects the board from pressure exerted by the user on the keyboard.  I decided to use it.

I decided to use a singular colour of block -- red -- as I had a lot of long planks that I could use fairly easily to give the keyboard some stability.  A bottom look of the layout is below:

The base is 40 by 19 blocks.  The height is 2 blocks.

A top view:

I hold together the base planks with various 1/3rd height blocks throughout.  I avoid the placing them in the mid-left area as the controller board will be seated here.  It's a region where I use the longest planks.

Along the inside, on the left and right I place various full height blocks.  The keyboard will rest on these and provide it stability when the user presses down.  The keyboard has a drop down on the right-top side (close to the print screen and page buttons).  I make use of this to lock the keyboard in its place by using a long 2 by 16 block of 1/3rd height.  The middle-top of the keyboard raises up (where the LEDs are), so I raise up by 1/3rd height and place another 2 by 16 block of 1/3rd height to further hold the keyboard.  This piece represents the highest point in the overlay (2 blocks high).

On the bottom I place some "roof tile" blocks (incline blocks).  These are perfect to provide the keyboard a slight slant down for comfort typing, but provide the needed support for preventing the keyboard from sliding.  In the middle-bottom, I extend out a bit with 2 layers of 1/3rd height blocks which will provide support for the trackpoint buttons, preventing them from flexing when pressing down.

The keyboard is in place.  On the left bottom, I ensure the keyboard doesn't move by using a 2 by 3 plank with a "peak roof tile" piece.  I decide to pop the FN key (otherwise the 2 by 3 plank prevents it from working).  I am still able to use the FN key, and for the amount that I use it, it really doesn't matter.  On the right side I place a second "peak roof tile" piece.  It prevents the right CTRL and right ALT from pressing down fully, but the keys do work, just not as comfortable as I'd like.  But these keys I don't use much, so I can live with it.

As you can see, I have it seated on my ultrabook.  I added some extension pieces on right to have it hug the ultrabook completely (so it doesn't slide).

The keyboard and trackpoint are very comfortable to use (believe it or not).

Now a little bit more of the magic that holds the keyboard in place.

A closer look on the left side, you can see a some 1 width blocks that connect to the far left bottom of the overlay.  These allow for room for the USB plug and power plug for the ultrabook.  They box in these plugs, adding support to prevent the keyboard from sliding back and forth.  There happens to be no ventilation holes on this side of the ultrabook, so the blocks with holes are purely decorative.

A closer look on the right side, you can see these "road barrier" blocks that I use to extend out from the bottom right side of the keyboard overlay.  These provide support for the right side of the keyboard from sliding.  They also provide appropriate access to the audio and USB connectors.  I run the USB cable from the controller inside the overlay out on this side as well.

That's everything :)

From an operational point of view, in Windows, the keyboard is detected as USB keyboard.  But if you install the Lenovo USB ThinkPad with trackpoint drivers, it will operate 100% of the function of a true ThinkPad keyboard (trackpoint, all the function keys, volume keys, etc).

In Linux, the keyboard is detected as an Ultranav Lenovo keyboard.  The function keys appear to be working, but I haven't fully tested them all (hibernation, sleep, etc).  Volume buttons work.  The trackpoint of course works, but I have't been able to get the trackpoint middle-button scrolling fully working.  Even on a ThinkPad, it doesn't work out-of-the-box until you've applied the following "fix":

#! /bin/sh
xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 8 1
xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Button" 8 2
xinput set-prop 'TPPS/2 IBM TrackPoint' "Evdev Wheel Emulation Timeout" 200
xinput set-prop 'TPPS/2 IBM TrackPoint' "Evdev Wheel Emulation Axes" 6 7 4 5

Replacing the  TPPS/2 IBM TrackPoint with the correct name, the fix doesn't appear to be having the desired effect.  Once I work it out, I'll post the fix.

The trackpoint sensitivity is also not adjustable.  You normally adjust it on a ThinkPad with:

echo -n 220 > /sys/devices/platform/i8042/serio1/sensitivity
There are no devices with a sensitivity control.

One of the questions you might be asking is what about the pressure on the ultrabook's keyboard and trackpad.  For the keyboard, the machine has a chicklet-style keyboard, and because the bottom of the overlay is perfectly flush, it doesn't press down on any keys.  Further, the trackpoint nor the use of it seems to have an effect (unwanted interaction) with the trackpad.  However, because I can foresee there being  problems, especially with accidentally resting my fingers on the trackpad, I disable them at my desire in Linux by running an xinput disable.  You can decipher the names of these devices by simply running xinput.  The trackpad showed up as a PS/2 Mouse under Virtual core pointer and the keyboard as AT Translated Set 2 keyboard.  I disable them by running xinput disable AT Translated Set 2 keyboard and xinput disable PS/2 Mouse.  My ultrabook also has touchscreen inputs, which are not affected by these changes.  You can substitute disable with enable to undo the changes.  Naturally, if you disable the inputs, they won't remain disabled after a reboot (so either run them again with a script manually or set them on bootup with /etc/init.d/rc.local).

No comments:

Post a comment