Looks like a hardware issue with the keyboard itself.
1. Try to see whether the keyboard is connected with your Mac (USB or otherwise)
2. If yes, I would buy the cheapest keyboard - you can have those for $10 at any large tech store
3. Plug that in your Mac and if it works, then the old keyboard was indeed broken - this happens especially if you spilled something on it.