Thursday 17 May 2012

The Tecra M7 Keyboard



A pc105 keyboard is a standard 102 key keyboard + Windows keys (L+R) and the right Menu key.
The UK Tecra M7 keyboard is approximately a pc105 keyboard (
the numeric keypad being activated by the Fn key) with no right Windows key and with additional keys: Shortcut 1; Shortcut; 3 Zoom keys; and various ACPI functions.

In addition, the Tecra M7 has 5 buttons on the screen bezel for use in tablet mode: screen; person; lock; rotate/cancel; and an up/down/left/right/enter joystick.

Some of the bezel keys work, but not the screen or person keys. Additionally, the zoom keys and the shortcutkeys next to the keyboard don't function.

Keyboard devices
xinput indicates that the keyboard devices are:
  • Virtual core XTEST keyboard
  • Power button
  • Video bus
  • Power button
  • AT Translated Set 2 keyboard
  • Toshiba input device
Using the KeyTouch Editor, we find that the Zoom keys come from the "Toshiba input device", the remaining keys (presumably) coming from the "AT Translated Set 2 keyboard".
 
However, KeyTouch itself is not available on Ubuntu 12.04 - the version of Linux under consideration so KeyTouch cannot be used to program the zoom keys.

Friday 11 May 2012

Rotating the display

In order to rotate the display I'm using XRandR.

This requires adding RandR support in /etc/X11/xorg.conf. The final "Device" section needs the RandRRotation option setting to true:

Section "Device"
        Identifier     "Device0"
        Driver         "nvidia"
        VendorName     "NVIDIA Corporation"
        BoardName      "Quadro NVS 110M"
        Option  "NoLogo"        "True"
        Option  "RandRRotation" "true"
EndSection

With that set, the screen orientation can be set by:

xrandr -o normal
xrandr -o right
xrandr -o inverted
xrandr -o left

Creating the following script as /etc/acpi/local/lid.sh.post means that whenever the screen is "opened", the screen reverts to normal rotation:

#!/bin/sh
stylus="Serial Wacom Tablet stylus"
eraser="Serial Wacom Tablet eraser"

# Check if the lid is now "open"
grep -q open /proc/acpi/button/lid/*/state
if [ $? = 0 ]
then
    xrandr -o normal
    xsetwacom set "$stylus" rotate none
    xsetwacom set "$eraser" rotate none
    xinput set-prop "$stylus" "Wacom Hover Click" 0
fi

Remember to chmod +x /etc/acpi/local/lid.sh.post

xsetwacom is used to set the orientation of the Wacom digitizer to match the screen orientation.