Here are three quick and dirty demos written in C for reading directly from the trackpad device. Requires X11 and OpenGL.
puck_demo - Move the square-shaped puck around using the trackpad
tracking_demo - Show the touches registered by the trackpad
rubber_band_demo - A crude example of the 'rubber band' effect
On my system (Thinkpad X220 running Slackware 14.2), the device file is '/dev/input/event14' which is also the mouse device. You'll have to experiment to find the correct device on your system, I'm not entirely sure how it works.
Copyright (c) 2018 Arthur Choung. All rights reserved.
Email: arthur -at- arthurchoung.com
Released under the GNU General Public License, version 3.
For details on the license, refer to the LICENSE file.