keyboards are 2 layers of plastic film with tiny electric contact, separated by a third layer of plastic film with holes on the spot of every single key.
when you press a key, the top and bottom plastic are pressed against one another inside the hole of the middle layer, and the electronic signal going from the top to the bottom layer tells your computer that the key is pressed.
problem is: separation is the same as an average good quality book paper sheet, or maybe the same as the aluminum sheet that makes a soda or beer can. also, the electricity that goes trough your keyboard is extremely tiny, and sensors are VERRY sensible, so your air battery can lasts longer.
So even if you have a single hair touching those circuits, your keyboard would "break" the same way it breaks when you spill coffee or whatever liquid; even after the liquid dries, the coffee and the sugar are probably still there "pressing" your alt key.
solution: (this will probably void any warranty) open your computer carefully, remove the keyboard, dismantle all keys one by one, separate the plastic layers with surgical precision so you don't cause any ruptures to the electric "wires", then wash everything with a lot of water and very little mild soap, take extra care to remove ALL the soap, leave everything to dry in the sun (you know electronic components don't like humidity, right?) assemble everything together with "just-washed" oil free hands (don't touch the inner part of the sensors now).
Doing all this, if you have any luck your keyboard might work 100% again... or maybe you might make it stop working entirely, who knows? =)
if you have some money, then backup you computer, go to the applestore and tell them you want to buy a new keyboard, because you broke the current one.
they shall give you a brand new (refurbished?) one, and charge you only the new keyboard. or they might give the same one back to you, who knows? haha.
Apple doesn't package the drivers or installers, so the best you could do is try these installs.
- Download the latest "Combo" updater for 10.x.x and install that package.
- Download the entire Yosemite Installer and then re-install the OS.
The only downside to option #2 is you need to download more data. It is the sure fire way to ensure everything is up to date. The only downside to #1 is that it might not work. Not everything is packaged in the combo updater - just the things that were updated. So if you choose that, you might waste the time downloading the small package and trying to install it.
Before you do anything, try rebooting in safe mode. That would disable any third party kernel extensions and let you know if the core OS is the problem. If the keyboard works there - you might just need to uninstall your VM and other modifications.
Best Answer
Did you have a Logitech keyboard at one time? If so, you might have an old Logitech kernel extension that is causing problems. Uninstall the Logitech control panel from System Preferences and look in
/System/Library/Extensions
and deleteLogitechHIDDevices.kext
andLogitechUnifying.kext
(reboot for extra certainty). Many people have had problems due to the Logitech stuff on Mountain Lion.If that's not it, your problem still could be caused by something similar. Third-party kernel extensions are transferred during a system migration. Likewise it could be a more run-of-the-mill extension conflict.