У меня сенсорный экран, но драйверы не работают должным образом и мешают работе мыши.
Можно ли отключить мой сенсорный экран, чтобы я снова мог нормально работать?
Вы можете попробовать отключить устройство ввода с помощью команды xinput
. Сначала посмотрите, какие устройства ввода у вас есть, просто введите:
xinput
И вы должны увидеть список вроде:
$ xinput
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Atmel Atmel maXTouch Digitizer id=9 [slave pointer (2)]
⎜ ↳ TPPS/2 IBM TrackPoint id=13 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=12 [slave pointer (2)]
...
Затем вы можете отключить нужное устройство ввода с помощью этой команды:
xinput disable 9
Где 9 - это идентификатор устройства, которое вы хочу отключить. Вы также можете использовать имя устройства в кавычках.
В xinput версии 1.5.99.1 вам нужно вместо этого выполнить xinput set-prop 9 'Device Enabled' 0
. Как ни странно на xinput v1.6.2 первый способ работает.
Решение xinput
у меня не сработало. Вместо этого я следовал инструкциям из этой ветки . Это отключит его во время загрузки.
/usr/share/X11/xorg.conf.d/10-evdev.conf
Опцию «Игнорировать» на «
в конец раздела с тачскрином
идентификатором ELAN Touchscreen
в xinput
. Отредактируйте файл с помощью
sudo nano /usr/share/X11/xorg.conf.d/10-evdev.conf
Измените MatchIsTouchscreen с «on» на «off» в разделе Touchscreen, чтобы он выглядел следующим образом:
Section "InputClass"
Identifier "evdev touchscreen catchall"
MatchIsTouchscreen "off"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection
Save, Name and Exit
Touchscreen отключен и больше не обнаруживается в списке xinput.
Поскольку идентификатор для xinput изменяется при перезагрузке, я добавил простой однострочный экран при загрузке сеанса:
#!/bin/bash
xinput --list | awk '/Atmel Atmel maXTouch Digitizer/ {print $7}' | awk '{split($0,a,"="); print a[2]}' | xargs xinput disable
Имя моего устройства - "Atmel Atmel maXTouch Digitizer", измените его на своем устройстве ( используйте xinput --list
для имени устройства).
Если ваш сенсорный экран представляет собой сенсорный экран, например монитор USB, вы можете добавить драйвер ядра по умолчанию usbtouchscreen
в файл черного списка modprobe ( /etc/modprobe.d/blacklist.conf
) и использовать свой собственный драйвер, такой как touchkit
или evtouch
.
Как показывает ответ @ romaia здесь , xinput
действительно правильный способ сделать Это.
Тем не менее, мне нравится писать сценарий и прикреплять вызов этого сценария к сочетанию клавиш Ctrl + Alt + P , чтобы упростить эту задачу. Теперь я получаю такое автоматически закрывающееся окно, когда использую этот ярлык в первый раз:
... и если я использую ярлык снова:
Ах, прекрасно! Теперь я могу легко включить / отключить тачпад или сенсорный экран, а также исправить скорость прокрутки мыши - и все это с помощью одного простого в использовании сочетания клавиш!
Получите последнюю версию этого скрипта здесь: https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/blob/master/toggle_touchpad.sh .
Вот его снимок на данный момент:
#!/bin/bash
# This file is part of eRCaGuy_dotfiles: https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles
# toggle_touchpad.sh
# - toggle the touchpad & touchscreen on and off, and enable/disable imwheel to fix scroll speed when using a mouse
# instead of the touchpad
# Gabriel Staples
# Started: 2 Apr. 2018
# Update History (newest on TOP):
# 28 Jan. 2020 - added in lines to disable Touchscreen too, as well as show ID numbers of
# Touchscreen & Touchpad
# 22 June 2019 - added in the imwheel stuff to not mess up track pad scrolling when
# track pad is in use
# References (in order of progression):
# 1. negusp described xinput: https://askubuntu.com/questions/844151/enable-disable-touchpad/844218#844218
# 2. Almas Dusal does some fancy sed stuff & turns negusp's answer into a script: https://askubuntu.com/questions/844151/enable-disable-touchpad/874865#874865
# 3. I turn it into a beter script, attach it to a Ctrl + Alt + P shortcut, & do a zenity GUI popup window as well:
# https://askubuntu.com/questions/844151/enable-disable-touchpad/1109515#1109515
# 4. I add imwheel to my script to also fix Chrome mouse scroll wheel speed problem at the same time:
# https://askubuntu.com/questions/254367/permanently-fix-chrome-scroll-speed/991680#991680
# 5. I put this script on Github, and posted a snapshot of it on this answer here:
# https://askubuntu.com/questions/198572/how-do-i-disable-the-touchscreen-drivers/1206493#1206493
# `xinput` search strings for these devices
# - Manually run `xinput` on your PC, look at the output, and adjust these search strings as necessary for your
# particular hardware and machine!
TOUCHPAD_STR="TouchPad"
TOUCHSCREEN_STR="Touchscreen"
read TouchpadId <<< $( xinput | sed -nre "/${TOUCHPAD_STR}/s/.*id=([0-9]*).*/\1/p" )
read TouchscreenId <<< $( xinput | sed -nre "/${TOUCHSCREEN_STR}/s/.*id=([0-9]*).*/\1/p" )
echo "TouchpadId = $TouchpadId" # Debug print
echo "TouchscreenId = $TouchscreenId" # Debug print
state=$( xinput list-props "$TouchpadId" | grep "Device Enabled" | grep -o "[01]$" )
PRINT_TEXT="Touchpad (ID $TouchpadId) & Touchscreen (ID $TouchscreenId) "
if [ "$state" -eq '1' ];then
imwheel -b "4 5" # helps mouse wheel scroll speed be better
xinput --disable "$TouchpadId"
xinput --disable "$TouchscreenId"
zenity --info --text "${PRINT_TEXT} DISABLED" --timeout=2
else
killall imwheel # helps track pad scrolling not be messed up by imwheel
xinput --enable "$TouchpadId"
xinput --enable "$TouchscreenId"
zenity --info --text "${PRINT_TEXT} ENABLED" --timeout=2
fi
sudo nano /usr/share/X11/xorg.conf.d/40-libinput.conf
# Match on all types of devices but joysticks
#
# If you want to configure your devices, do not copy this file.
# Instead, use a config snippet that contains something like this:
#
# Section "InputClass"
# Identifier "something or other"
# MatchDriver "libinput"
#
# MatchIsTouchpad "on"
# ... other Match directives ...
# Option "someoption" "value"
# EndSection
#
# This applies the option any libinput device also matched by the other
# directives. See the xorg.conf(5) man page for more info on
# matching devices.
Section "InputClass"
Identifier "libinput pointer catchall"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
Section "InputClass"
Identifier "libinput keyboard catchall"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
#Section "InputClass" <----
# Identifier "libinput touchscreen catchall" <---- this one
# MatchIsTouchscreen "on" <---- put # in
# MatchDevicePath "/dev/input/event*" <---- front of
# Driver "libinput" <---- every line
#EndSection <----
Section "InputClass"
Identifier "libinput tablet catchall"
MatchIsTablet "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
У меня сломался тачскрин "Dell Inspiron". Курсор двигался повсюду и щелкал в случайных местах несколько раз в секунду. Я не смог даже войти в гном или даже получить доступ к биосу.