Touch Screen (Gumstix)

Calibrate the screen:
$ cd /usr/bin
$ ts_calibrate

when I run my Qt project, the mouse curse is still incorrect. That's because the Qt does know which touch screen library can be used.
//$ export QWS_DISPLAY="VNC:LinuxFB"
$ export QWS_MOUSE_PROTO="tslib:/dev/input/touchscreen0"

Hint 1: in /~ directory, ".profile" contains commands to be executed after log on.
Therefore, I can add these two export files in ".profile" to load these two command lines automatically when I log in. Alternative, ".bashrc" file does the same job as ".profile" does.

Hint 2: In almost Linux system (except Ubuntu), system checks /etc/inittab file first when start pc. You can tell which run level is the default from it. Normally rc5 is the default run level. You can add you own applications in rc5.d/S99xxx. The system will run these applications automatically (before log in step).
system will run rcS.d first, then rc5.d

a) applications should be added after "rm nologin"

#! /bin/sh
# rmnologin     This script removes the /etc/nologin file as the last
#               step in the boot process.
# Version:    @(#)rmnologin  1.00  22-Jun-1998

if test -f /etc/nologin.boot
        rm -f /etc/nologin /etc/nologin.boot

# add from here
export QWS_DISPLAY="VNC:LinuxFB"
export QWS_MOUSE_PROTO="tslib:/dev/input/touchscreen0"
/home/czhang/m4 -qws &

: exit 0

b) applications should followed by '&' to make sure they all run on the background, and not affect the login step.

/home/czhang/m4 -qws &

Note: Qt has a build in vnc. we can remotely view the program running on gumstix screen.
I installed vncviewer on my ubuntu machine, and run as:
$ vncviewer 10.0.0.xx      (gumstix IP address)

To use standard USB mouse in gumstix, use following command:
$ export QWS_MOUSE_PROTO= Auto

No comments:

Post a Comment