Without unplugging my keyboard I’d like to disable it from the terminal; I was hoping that this could be done using rmmod but based on my currently loaded modules it doesn’t look like it is possible.
Does anyone have any ideas?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
There are pretty good directions on doing it here, titled: Disable / enable keyboard and mouse in Linux.
Example
You can list the devices with this command.
$ xinput --list "Virtual core pointer" id=0 [XPointer] "Virtual core keyboard" id=1 [XKeyboard] "Keyboard2" id=2 [XExtensionKeyboard] "Mouse2" id=3 [XExtensionKeyboard]
And disable the keyboard with this:
$ xinput set-int-prop 2 "Device Enabled" 8 0
And enable it with this one:
$ xinput set-int-prop 2 "Device Enabled" 8 1
This only works for disabling the keyboard through X. So if you’re on a system that isn’t running X this won’t work.
List of properties
You can use this command to get a list of all the properties for a given device:
$ xinput --list-props 2
Device 'Virtual core keyboard':
Device Enabled (124): 1
Coordinate Transformation Matrix (126): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0