The "left right click training" activity is suitable for mouse attached devices, so it should be visible only on those devices and invisible for touch devices. This can be done using QInputDevice.
Documentation for QInputDevice - https://doc.qt.io/qt-6/qinputdevice.html
Source code - https://code.woboq.org/qt6/qtbase/src/gui/kernel/qinputdevice.h.html#63