Immediately unplug the input device, then:
Mouse: Ok, the odds are good here. Go get a paper towel and dry it off. Since a mouse has few cracks in the case you should be able to salvage it.
Keyboard: Get a towel and double it over and flip the keyboard over to drain out the liquid. Give this a few minutes. Sadly here’s your chances are worse due to all of the spaces between the keys and the case. If after the toweling it is still wet use a blow drier on the cold setting. If the keys or case is sticky use screen wipes to fix that. If it does not work you will have to replace the keyboard.
Once sure the device is COMPLETELY dry, reconnect it and hope for the best.