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.
This happened to me too with my macbook pro 15 (mid 2012) running yosemite. What I did is took a flashlight and see if there was an image still on the screen. What I found out is that I was able to see the log in screen but it was all dark. After logging in all was back to normal.
Eventually if that doesn't work you can reset the pram of your computer. Follow this link http://support.apple.com/en-us/ht3964 .
Best Answer
From macOS help:
If you have two Mac computers with FireWire or Thunderbolt ports, you can connect them so that one of them appears as an external hard disk on the other. This is called target disk mode.
Connect the two computers with a FireWire or Thunderbolt cable.
On the Mac you want to use as the disk in target disk mode, do one of the following:
If the computer is off, start it up while holding down the T key.
If the computer is on, choose Apple menu > System Preferences, click Startup Disk, then click Target Disk Mode.
When the computer has started up, a disk icon appears on the desktop of the other computer.
Transfer files by dragging them to and from the disk.
Eject the disk by dragging its icon to the Trash. While you drag, the Trash icon changes to an Eject icon.
On the Mac you used as a disk, push the power button to shut it down, then disconnect the cable.
The Apple Target Disk Mode support article is here.