I have a brand new R13 and am having the same problem. I'm not sure what is turning the touchpad and keyboard off. I suspect it is the laptop itself, and linux doesn't know it is happening.
I have a partial fix that may help you. I wish I had a full solution.
The following script will restore your keyboard and possibly your touchpad. If the touchpad is not restored, then Fn+t will turn it back on:
#!/bin/sh
[ "root" != "$USER" ] && exec sudo $0 "$@"
lsmod |grep hid|cut -f1 -d" "|xargs -n1 rmmod
udevadm trigger
sleep 1
xinput|grep SYN1B|cut -f2 -d"="|cut -f1|xargs -n1 xinput --enable
There is a wrinkle though. It may need to ask for your password to run as root. In my case, I have a onscreen keyboard (like onboard, or cellwriter) so that I can enter the my password. An external keyboard works too.
Strangely, I have found that after running the above script once, my laptop is no longer disabling the screen and touchpad. I don't have time to see if it's a one-off thing, or happens every time.
I have limited time to play, though, so this partial answer is what I have for now. Here's hoping it helps someone come up with a complete solution.
Later edit as requested: The script removes all kernel device drivers that had HID (Human Interface Device) in the name, which includes the touchpad drivers, digitizer pen, keyboard, etc., and then tells udev to trigger the installation of any missing device drivers, which reinstalls them. This hopefully resets the drivers for those devices (and gets the keyboard back). Then we wait a second, get a list of X input devices and specifically enable the one that corresponds to the touchpad. This gets the touchpad back unless it's disabled by the laptop itself, in which case Fn+t on the (now working) keyboard gets it back.
Line by line:
1: Use /bin/sh shell to run script
2: If we aren't root, sudo and rerun the script
3: List all modules, remove modules with "hid" in the name
4: Insert modules for any devices for which drivers are not present
5: Wait 1 second
6: List X input devices, find one with SYN1B in the name, enable it.
It's a brute force solution, but it's a start. I'll do a better job narrowing down the problem later, when I'm not moving to another continent. :)
lsmod | grep '^[^ ]*hid' | cut -f1 -d " " | xargs -n1 rmmod
I followed the instructions of this answer to run it without the need of a password: http://askubuntu.com/a/155827/448526 Now things are working fine :) – narranoid Feb 19 '16 at 00:36