02-19-2021, 05:25 PM
@pkdick
Yes, the two commands @Macdelf showed you can be rolled into a bash script.
Disabling and enabling the touchscreen from the command line is possible too but it requires additional steps.
1. install the xinput utility
2. find the input id for the touchscreen, looking for the raspberrypi-ts entry
3. Now you can disable/enable the touchscreen input with
---
So, for example, on one of my moOde players with the official 7" LCD touch display (and a USB volume control knob and a FLIRC USB device)
I can disable the touchscreen with
and enable it again with
Note that this works independently of the display, e.g., you can turn the touchscreen off and on whether the display is on or off. This can lead to confusion
Regards,
Kent
Yes, the two commands @Macdelf showed you can be rolled into a bash script.
Disabling and enabling the touchscreen from the command line is possible too but it requires additional steps.
1. install the xinput utility
Code:
sudo apt install xinput
2. find the input id for the touchscreen, looking for the raspberrypi-ts entry
Code:
DISPLAY=:0.0 xinput --list
3. Now you can disable/enable the touchscreen input with
Code:
sudo DISPLAY=:0.0 xinput disable <id>
sudo DISPLAY=:0.0 xinput enable <id>
---
So, for example, on one of my moOde players with the official 7" LCD touch display (and a USB volume control knob and a FLIRC USB device)
Code:
pi@moodeLD:~ $ DISPLAY=:0.0 xinput --list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ flirc.tv flirc Consumer Control id=7 [slave pointer (2)]
⎜ ↳ Arduino LLC iWit USB Controller Mouse id=11 [slave pointer (2)]
⎜ ↳ Arduino LLC iWit USB Controller Consumer Control id=12 [slave pointer (2)]
⎜ ↳ raspberrypi-ts id=9 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ flirc.tv flirc Keyboard id=6 [slave keyboard (3)]
↳ flirc.tv flirc System Control id=8 [slave keyboard (3)]
↳ flirc.tv flirc Consumer Control id=10 [slave keyboard (3)]
↳ Arduino LLC iWit USB Controller Consumer Control id=13 [slave keyboard (3)]
↳ Arduino LLC iWit USB Controller Keyboard id=14 [slave keyboard (3)]
I can disable the touchscreen with
Code:
sudo DISPLAY=:0.0 xinput disable 9
and enable it again with
Code:
sudo DISPLAY=:0.0 xinput enable 9
Note that this works independently of the display, e.g., you can turn the touchscreen off and on whether the display is on or off. This can lead to confusion
Regards,
Kent