Re-seat the connections to the motherboard, test with an external keyboard.  Using an external keyboard, remove the keyboard from device manager and re-boot so it detects it again.  If external keyboard works fine and a reboot did not help after removing the device, likely you need a new keyboard.  As a test you can try booting off a Linux Live disk and see if the keyboard works normally there.  If it does then possibly re-installing Windows can fix things.