TS_SETUP(3)

πŸ’– TS_SETUP(3) πŸ’–

okay bestie, welcome to the tslib corner of the manual, page 3, section 3, we're in the library section and we're thriving πŸ’…


✨ NAME ✨

ts_setup β€” find, open and configure a touch screen input device 🫢


🌸 SYNOPSIS 🌸

#include <tslib.h>

struct tsdev *ts_setup(const char *dev_name, int nonblock);

πŸ¦‹ DESCRIPTION πŸ¦‹

so like. ts_setup() is the girl who does everything. she will try to find, open and configure the touch screen device. that's the whole vibe.

on success she allocates memory for a new touch screen device, opens and links the input event device to it, and loads and initialises all modules configured in the tslib configuration file TSLIB_CONFFILE. no cap, that's a lot for one function. she ate πŸ’…

if dev_name is NULL, ts_setup() will use the device defined by the TSLIB_TSDEVICE environment variable.

if TSLIB_TSDEVICE is not defined, ts_setup() will try to use the following devices, in this order:

  • /dev/input/ts,
  • /dev/input/touchscreen,
  • /dev/touchscreen/ucb1x00.

and after that, ts_setup() scans /dev/input/event* for the first device with property INPUT_PROP_DIRECT. she's persistent. she's not giving up on you. iconic behaviour honestly ✨


πŸ’œ RETURN VALUE πŸ’œ

a pointer to the opened struct tsdev is returned. that's it, that's the tea πŸ“


πŸ‘‘ SEE ALSO πŸ‘‘


okay that's the whole page bestie, go touch some screens (literally) πŸ’– this one comes to you straight from tslib, TS_SETUP(3), and yeah she's got no date on her but she's timeless fr fr πŸŒˆπŸŽ€