disable mouse pointer and keyboard by Ubuntu Terminal

Questions about Wine on Linux
Locked
javad1378
Newbie
Newbie
Posts: 3
Joined: Fri Aug 09, 2019 12:42 pm

disable mouse pointer and keyboard by Ubuntu Terminal

Post by javad1378 »

I connected two mouses and keyboards to my laptop (in /dev/input I have 2 mouses and keyboards) and I want to disable only one of mouses and keyboards in a specific wine virtual drive only by "Ubuntu terminal" or "cmd windows".
Is there any way to do this by a command ???
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: disable mouse pointer and keyboard by Ubuntu Terminal

Post by jkfloris »

Probably there are other solutions, but you can "disable"[1] your mouse and keyboard with "loginctl" in Ubuntu
(WARNING: This will disable your mouse on your laptop. If something went wrong, remove the 72-seat-*** files in /etc/udev/rules.d/)

Find your devices with:

Code: Select all

loginctl seat-status seat0
For example the output is:

Code: Select all

...
│ usb:usb1
│ ├─/sys/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/0003:03F0:1198.0001/input/input0
│ │ input:input0 "HP HP USB 1000dpi Laser Mouse"
...
You can disable and enable your mouse with:

Code: Select all

# disable mouse
loginctl attach seat1 "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/0003:03F0:1198.0001/input/input0"

# enable mouse
loginctl attach seat0 "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/0003:03F0:1198.0001/input/input0"
[1] The device is moved to an other seat. Read https://www.freedesktop.org/wiki/Softwa ... multiseat/ for more information.
Locked