It might be a corrupted keyboard driver of combo keyboard/touchpad driver. What happens if you connect a regular desktop keyboard to the laptop? Does that still work when the built-in keyboard stops working?