I configured my laptop so the display screen stays on and unlocked when I close the lid, because I want to do sleep and lock manually when I need it to.
This works fine so far with only one drawback, because I have a touchscreen:
When the touchscreen lid is closed and I carry it around into the next room the keyboard-keys touch automatically on random points on the screen, And when I open the lid, lots of funny things happened ;)
At the moment I use a workaround with the dconf-editor:
sudo apt-get install dconf-tools
Open dconf-editor and navigate to org.gnome.settings-daemon.plugins.power and set lid-close-ac-action and lid-close-battery-action there to "blank" or "suspend":

But this is not perfect because it also locks the screen, I would like to keep the screen unlocked but still disable the touchscreen while the lid is closed.
So How can I disable touch when the lid is closing and enable it when opening? How can I configure this?
I use a Lenovo Yoga 2 Pro
possible attempt: I know of a bug, that the touchscreen gets disabled if I turn on the power save option of my touchscreen. I could put this in two scripts that are called when there is a Catch lid close and open events and another script that disables power save when opening the lid