I have a laptop with a fold back display (Toshiba Satellite P50W). When I fold it all the way back it acts more like a tablet, however the keyboard is still active an easy to bump keys on.

I'm pretty sure these laptops have a sensor on the hinge so they can tell they are folded back and cause the keyboard to disable / go into tablet mode. This doesn't appear to work in Ubuntu. I haven't been able to find where such a sensor would be in Linux (doesn't seem to show up in the ACPI code, or in dmesg).

Does anyone know how to get it to work in Ubuntu?

  • The Lenovo Yoga line also has a similar hinge and appears not to be currently supported - see askubuntu.com/questions/812508/… – Robert Ancell Jan 3 '17 at 7:01
  • 1
    The first step is to run acpi_listen to see if a signal is sent when your laptop is morphed into a tablet. After that it's straight forward to disable keyboard and reenable when it morphs back from tablet to laptop. – WinEunuuchs2Unix Jan 3 '17 at 7:11
  • I had tried acpi_listen and I don't seem to get any event. – Robert Ancell Jan 4 '17 at 21:41
  • Do you get events listed for lid close and open, ie suspend & resume? – WinEunuuchs2Unix Jan 4 '17 at 22:44
  • Yes. I'm not sure if the events go over some other bus or there needs to be kernel support for this event (or even if it doesn't exist at all?) – Robert Ancell Jan 7 '17 at 20:31

I have the following script to disable my laptop keyboard (as a file in ~/.local/bin/disable_laptop_keyboard)

KeyboardID=`xinput --list | grep "AT Translated Set 2 keyboard" | sed 's/[^=]*=\([1-9]*\).*/\1/'`
sudo xinput set-int-prop $KeyboardID "Device Enabled" 8 0

And then I have a similar enable_laptop_keyboard file where the only difference is that it says 8 1 instead of 8 0 on the last line.

You will just have to figure out which string identifies the keyboard that you want to disable. In my case it is "AT Translated Set 2 keyboard". If you first run xinput --list | grep keyboard you should be able to find out what your keyboard is called.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.