The better fix is:
1) make sure the surface keyboard is attached to the computer
2) to go to Device Manager > Human Interface Devices
3) for every "USB Input Device", go to Properties. then go to the Power Management tab and uncheck the "Allow computer to turn off this device..." option