[kubuntu] My keyboard randomly stops working

view story

http://ubuntuforums.org – The keyboard on this laptop keeps failing, most usually within an hour of being switched on. If I reboot it works again, logging out does not work because I cannot enter a password. This problem seems to have started after I removed the keyboard to clean the fan although I did not disconnect the ribbon cable. I did have a look to see if I had trapped or damaged the cable but could not see anything obviously wrong. Anyone have an idea of what is going wrong? The laptop is an HP Compaq 6715b (Hardware)