Ubuntu: Can I make my keyboard disable / enter tablet mode when folding back my display?


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?


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

#!/bin/bash  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.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »