It is possible that your motherboard is defective. This can happen from physical damage for example, dropping the laptop, or it could be a factory defect. There is not much you can do other than replacing the motherboard yourself or sending it to the manufacturer. In order to do this check out this guide:Acer Aspire 5742 Motherboard Replacement
It is possible there is a problem with your keyboard in general. It seems like it is malfunctioning. If this is the case you may need to buy a new keyboard. If you would like to replace the keyboard, I recommend following this guide: Keyboard Replacement Guide