do nothing log

How to turn off laptop keyboard

Posted in linux by niteria on May 11, 2009

Half a year ago I accidentally spilled soda on my laptop keyboard. Of course I’ve cleaned and dried it but once in a while some keys press themselves.  The issue became annoying when I was watching movies and mplayer just kept turning off. I didn’t want to replace broken keyboard, because I already use usb one. I spend half a day investigating and as it came out it’s not all that easy to turn off laptop keyboard.

Here are solutions I’ve found:

  1. Disconnect keyboard physically – not an option for me, I still want to use that keyboard when I’m out
  2. Edit your /etc/X11/xorg.conf so your InputDevice section looks like that:
    Section "InputDevice"
    Driver "evdev"
    Option "Protocol" "evdev"
    Option "Device" "/dev/input/event6"
    Option "evBits"  "+1"
    Option "keyBits" "~1-255 ~352-511"
    Option "Pass"    "3"
    Option "XkbModel" "evdev"
    Option "XkbRules" "evdev"
    Option "XkbLayout" "pl"
    EndSection
    

    Where /dev/input/event6 is your usb keyboard (you can find out that by looking at the symlinks in /dev/input/by-id/).
    You may want to adjust layout option.
    Well, it almost worked for me. I couldn’t type my regional characters using alt-char combination.
    It would’ve worked if I had ‘evdev-managed’ in my kde keyboard layout settings.
    I didn’t have it and other layouts messed my layout (my up arrow was printscreen, left arrow was alt etc.), so I had to turn it off.

  3. Make two files:
    turn-off-laptop-keyboard.sh

    #!/bin/bash
    echo -n "manual" > /sys/devices/platform/i8042/serio0/bind_mode
    echo -n "psmouse" > /sys/devices/platform/i8042/serio0/drvctl
    

    turn-on-laptop-keyboard.sh

    #!/bin/bash
    echo -n "auto" > /sys/devices/platform/i8042/serio0/bind_mode
    

    Execute them from root prompt (executing with sudo won’t work).
    I don’t know how portable that is, so you may have to find out if you have serio0 and if it is your laptop keyboard. My laptop is Fujitsu-Siemens Amilo M3438.
    It disables laptop keyboard in both X and console.