Car PC User Interface

By: will

23 Dec 2009

Now that I've got the touchscreen hardware working properly, I'll be using some of my time off over the Christmas break to start developing the User Interface for the Car PC project, which I've revived in a fit of motivation.

For this project, I'm going to be using Trolltech's Qt library to handle everything to do with the user interface and media playback. I've chosen this platform as it's fairly lightweight and fast, which are good choices for an embedded project like this.

But the user interface is what is going to make or break this project, I need something simple and intuitive, with minimal clutter. I've decided that I'm going to have a single main 'status' screen, which will have a number of application 'launchers' which will throw you into a specific tool.

I'm not good with design, so I decided to have a think about what touchscreen interfaces have this kind of layout and would work well. While I was thinking about this I got a text message on my iPhone, and knew I'd be going straight to hell.

... and whilst I haven't decided what widgets/gears/etc will be on the main status page, I've blatently ripped a very famous interface. I give you the main screen of my CarPC:

Yeah I know, but I like it so deal with it. I had a very brief attempt at designing some user interfaces for the maps/music applications (see below), to get a feel for how I'd be using the screen space.

Whilst cluttered, I'm trying to keep most of the touch interface buttons in the same horizontal strip as the main menu. Also, the position of the 'return to main menu' button at the far right of this strip needs to be maintained. Beyond that, I really do want to keep things conforming to the Apple iPhone User Interface Guidelines document - however given the application I'll be relying on high contrast graphics where I can.

So with any luck, doing the user interfaces consistantly should be a case of figuring out what icons I need and finding a consistant set to keep the theming constant.

In either case, I hope to have a very basic user interface framework coded up by the end of the break.

After suprisingly little stuffing about, I managed to get my Lilliput 7" touchscreen working under X.org in Ubuntu.

The lilliput touchscreens are powered by eGalax touch controllers, which is supported by usbhid in the 2.6 kernel - so if you check the contents of dmesg, you will see an entry corresponding to the touchscreen device. For example:

input: eGalax Inc. Touch as /class/input/input4
input,hiddev96: USB HID v1.12 Pointer [eGalax Inc. Touch] on usb-0000:00:1d.2-2
usbcore: registered new interface driver usbhid
drivers/usb/input/hid-core.c: v2.6:USB HID core driver

If you have a look at /proc/bus/input/devices you should also see a corresponding entry for the device:

I: Bus=0003 Vendor=0eef Product=0001 Version=0112
N: Name="eGalax Inc. Touch"
P: Phys=usb-0000:00:1d.2-2/input0
S: Sysfs=/class/input/input4
H: Handlers=mouse1 event4 ts1
B: EV=b
B: KEY=401 0 30000 0 0 0 0 0 0 0 0
B: ABS=f

Then it's as simple as installing the xserver-xorg-input-evtouch package which will install x support for this device. However, the HAL policy for this device doesn't work reliably to being with - as the X and Y coordinates on these panels are swapped.

To fix this, edit the file /usr/share/hal/fdi/policy/20thirdparty/50-eGalax.fdi, and insert the following line:

<merge key="input.x11_options.rotate" type="string">cw</merge>

I also found that the min/max X/Y options to be poor choices for this display, I set the min and max values in both directions to 0 and 2000 respectively.

Then all you have to do is add an InputDevice section into your x.org configuration as follows. Make sure the Device key points to the event handler listed in the /proc entry from above:

Section "InputDevice"
Identifier "touchscreen0"
Driver "evtouch"
Option "Device" "/dev/input/event4"
Option "DeviceName" "touchscreen"
Option "MinX" "0"
Option "MinY" "0"
Option "MaxX" "2000"
Option "MaxY" "2000"
EndSection

Voila! Start X and your touchscreen should work like a charm. If you don't want X to whinge that it's your only input device, make sure you enable the CoreInput option in the InputDevice definition.

There you go!

This is the personal website of Will Dowling, a Systems Engineer haliing from Perth, Western Australia.

The signal-to-noise of this site can vary wildly, so here's a few things I'm reasonably happy with that might be of interest to other people:

The Case FOR Apple
11/08/2009
On projects and discovery
04/08/2009
Naughty Tax
18/06/2009

User login