Question about connectable touch device by function GetTouchDeviceIndices

Dear psychtoolbox community,

I would like to know which specific device can be recognized as a touch device (by function GetTouchDeviceIndices), because I have tried Apple’s Magic Trackpad2 (Model A1535) and iPad Pro 12inch (2018Model) on my Linux PC (Ubuntu22.04, MATLAB2022a, Psychtoolbox 3.0.1) , but none of them were recognized as a touch device.

Thank you in advance.

Kazutosih Kudo
authentication token:

Hi again,

so on Linux, GetTouchDeviceIndices() will consider any touch screen or touch pad which is recognized/supported by the operating system and X-Server as suitable for use with the multitouch input functions (e.g., MultiTouchDemo.m and MultiTouchMinimalDemo.m). You can use the optional touchTypeOnly parameter to select only touchpads (0) or only touchscreens (1), but by default it will choose either one.

help TouchInput has an explanation and some setup instructions for touch pads, although a bit more terse than explained here:

True touchscreen will get recognized automatically by default.
Touch pads on the other hand will need a special config file to mark them as “touchscreen like” instead of “mouse like”. For that you have to:

  1. copy the filePsychtoolbox/PsychHardware/99-evdev-touchscreen.conf into the folder /etc/X11/xorg.conf.d

  2. Edit the file /etc/X11/xorg.conf.d/99-evdev-touchscreen.conf to uncomment the 2nd input class section at the bottom of the file, ie. remove the # hash-marks. This will enable use of the evdev input driver for handling all touchpads and also mark them as “touchscreens” instead of “mice”.

  3. Execute sudo apt install xserver-xorg-input-evdev to install the evdev driver, as it is not installed by default on a fresh Ubuntu 22.04.

  4. Logout and login again.

→ Now all your touchpads won’t work as touchpads anymore, but GetTouchDeviceIndices() should enumerate them, and demos like MultiTouchDemo should be able to recognize and report multi-touch input.

To go back to the old state, just move the 99-evdev-touchscreen.conf file out of /etc/X11/xorg.conf.d/ and logout + login again.

If you only wanted to treat some touch pads as multitouch input, you could add an additional line MatchProduct "Productname" to that config file, which matches against specific touchpad product names, e.g., MatchProduct "Magic" to only apply to products with “Magic” in their product name may restrict this to the Apple Magic Trackpad2.

Section "InputClass"
  Identifier "evdev touchpad override catchall"
  MatchIsTouchpad "on"
  MatchProduct "Magic"
  MatchDevicePath "/dev/input/event*"
  Driver "evdev"

As far as I can see, the Apple Magic Trackpad2 should be supported by Ubuntu 22.04, and i tested our code once with a lent Magic Trackpad1 many years ago.

I don’t know - or wouldn’t know how - to connect a iPad Pro to a Linux PC and use it as a touch input device? Did you find some info on the web to the contrary? At least I never heard of that.

Edit: There is one way to use any Smartphone/Tablet with a touchscreen and a touch-capable web-browser at least as a mouse on Linux. The Ubuntu appstore has the free “remote-touchpad” application. This allows basic mouse input and a bit of keyboard input. However, no multitouch “touchscreen” style input, and the latency is high, as this works over Wifi network, so only for limited use cases.

I will also mention that using touchpads as “touchscreens” is only supported on Linux. Windows only allows use of real touchscreens as touchscreens. macOS doesn’t know what a touchscreen is.

[20 minutes out of 30 minutes of paid support used up].