Tipping your hat is a very polite way of saying hello.
Really sophisticated gentlemen use a hat like this.
It makes Morse code sounds when it is raised.
Its secret is seen here: inside there is a small audio oscillator (a buzzer) and a tilt switch.
Whenever the hat is tilted a sound is heard.
Closer view. The small metallic cylinder is the tilt switch. Safety pins hold things in place.
See how the hat is used in this video clip:
You might also want to check out my Handshake CW key.