How to disable laptop keyboard in Linux mint

Folks, let's try to focus on the OP's question rather than cracking all the jokes or going off topic.
I wasn't joking: there's no good reason to disbable a laptop keyboard unless you have great eye sight. Ive hooked in different keyboards, and it was very dissapointing.
 


...there's no good reason to disbable a laptop keyboard...

... that you can see , should be added.

The OP may have another reason, which we may learn once we can get away from the cats, lol.

Wizard
 
... that you can see , should be added.

The OP may have another reason, which we may learn once we can get away from the cats, lol.

Wizard
My cats are the reason. I might be using a laptop a bit longer. I don't want to buy a monitor. My cats routinely walk in front of or over whatever is in front of me. They consistently shove their heads into my palms demanding to be pet.
 
OK :)

If you unplug your external keyboard (or switch off if wifi) for a moment and gently brush aside a feline, see if you can capture the output of

Code:
xinput list

Then plug the external back in and repeat the exercise.

Give us the output for both (preferably in code tags) and we can work from there.

Mine with just the one inbuilt keyboard looks like this

Code:
chris@VeraXfce-HDD:~$ xinput list
⎡ Virtual core pointer                        id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                  id=4    [slave  pointer  (2)]
⎜   ↳ Logitech Wireless Receiver Mouse            id=10    [slave  pointer  (2)]
⎜   ↳ DELL0811:00 044E:120A Mouse                 id=11    [slave  pointer  (2)]
⎜   ↳ DELL0811:00 044E:120A Touchpad              id=12    [slave  pointer  (2)]
⎜   ↳ AlpsPS/2 ALPS GlidePoint                    id=18    [slave  pointer  (2)]
⎣ Virtual core keyboard                       id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard                 id=5    [slave  keyboard (3)]
    ↳ Power Button                                id=6    [slave  keyboard (3)]
    ↳ Video Bus                                   id=7    [slave  keyboard (3)]
    ↳ Power Button                                id=8    [slave  keyboard (3)]
    ↳ Sleep Button                                id=9    [slave  keyboard (3)]
    ↳ DELL0811:00 044E:120A UNKNOWN               id=13    [slave  keyboard (3)]
    ↳ Intel HID events                            id=14    [slave  keyboard (3)]
    ↳ Intel HID 5 button array                    id=15    [slave  keyboard (3)]
    ↳ Dell WMI hotkeys                            id=16    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard                id=17    [slave  keyboard (3)]
 
Further to the above, I will give you the rest so that you can accomplish this while we are both online and offline at different times.

First of all, as a precaution, it may be wise to launch your Virtual (on screen) Keyboard, so that if things go wrong, you can still have access to entering commands. Also, unplug or switch off your external keyboard, if you have one available.

You can do that from the Menu, with Settings - Preferences - Accessibility - Keyboard and move the toggle switch to On. To switch it off when you are finished, reverse the toggle switch, or on the virtual keyboard you can click an icon of a small keyboard near its top right.

Let's take a look at my xinput output above.

Under

⎣ Virtual core keyboard

I have two (2) entries for keyboard. Mine is actually the bottom one

↳ AT Translated Set 2 keyboard id=17

To temporarily disable my keyboard, I can type in either of

Code:
xinput disable 17

OR

xinput disable "AT Translated Set 2 keyboard"

My keyboard is then disabled for the duration of the computer session I am in, but will be re-enabled following a power down and restart or a reboot.

You could then reconnect your external keyboard and continue from there.

To re-enable the keyboard during the same session

Code:
xinput enable 17

OR

xinput enable "AT Translated Set 2 keyboard"

How to make this permanent?

Maarten's link to Baeldung in #6 gives some pointers, but I use a more complete method.

If you are using X11/Xorg (not Wayland), and you likely are on Mint, there is a file

libinput.conf

(on some distros, it will be synaptic.conf)

Full path is

/usr/share/X11/xorg.conf.d/40-libinput.conf

and we can edit that to make the changes and save it.

You can use the CLI Text Editor Nano in Terminal, or (as Root) the GUI Text Editor (xed for Mint), I use Nano.

My content is in the Spoiler below (click to open, click to close)

cat /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"
MatchIsTouchscreen "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection

Section "InputClass"
Identifier "libinput tablet catchall"
MatchIsTablet "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection

I use my arrow keys to go to the section beginning

Section "InputClass"
Identifier "libinput keyboard catchall"

and comment out the entire section, so it is now

Code:
#Section "InputClass"
#        Identifier "libinput keyboard catchall"
#        MatchIsKeyboard "on"
#        MatchDevicePath "/dev/input/event*"
#        Driver "libinput"
#EndSection

Save the file, reboot, and your internal keyboard is now disabled longterm.

To revert changes at a later time, just edit the file again to remove the hashes, save and reboot.

Fire away with any questions.

Wizard
 
I can't do this for a few days . Things are pretty hectic right now
 
Understood - take your time.

Chris
 

Members online


Top