What model is the computer? Sugar makes things stick, and can be an insulating barrier on contacts. Since the rest of the computer works, it didn't get on anything else that would cause a short-term problem. Probably not long-term either.
If you have nothing to lose, remove the keyboard and wash thoroughly in hot water only, do not use soap. Let dry for several days in a warm, dry location, maybe in front of a fan. It still may not work. The design of the contacts on many low-profile keyboards allows liquid in but makes it nearly impossible to clean out. (Usually little rubber domes, glued down at the corners. Liquid hits the sides and gets sucked in through surface tension.)
Replacing laptop keyboards isn't too hard. There are several cable connector latch styles, and some are fragile. $35 for a replacement is not a bad price.