There are multiple switches and buttons in the cockpit, with different shapes and layouts. Are they spill proof?
What if the pilot spills water or coffee on them, will they still function?
No they are not, at least not fully. There have been instances of equipment failure caused by coffee spills, resulting in the need to abort the flight.
This example shows a flight that needed to divert because a coffee spill disabled the communication equipment.
This Boeing 707 had to make an emergency landing after the crew inadvertently spilled water on the autopilot panel causing the stabilizer trim wheel started to rotate. Control was lost as the plane pitched up and down. Three people died in the accident.
This Boeing 720 suffered control problems (resulting in Dutch roll) after a coffee spill cause a short circuit in the yaw damper.
This Airbus A330 diverted for an emergency landing after liquid was spilled onto electronic devices in the cockpit causing the smoke.
Source: Transport Accident Investigation Commission of New Zealand
On the old Zeppelins all electrical switches were enclosed, with the actual switching contacts submerged in oil to avoid sparks. And Zeppelins had a lot of switches, containing much more electrical equipment than typical aircraft of their times. All these switches were also spill-proof by design. Airship engineering seems to be a lost art ...
Left: Radio operator of a WW I Zeppelin at his equipment, right: Elektroraum of the LZ 127.