Films often use an audio cue when a gun is moved, handled, or pointed. Usually this is some kind of 'clicking' or cocking sound. Given how widespread this practice seems to be, I'm wondering which film originated this technique.
It's older than film. Radio dramas used sound artists for years. For that matter, its older than radio, radio borrowed techniques that had been used in theatre for probably centuries. (Off stage thunder sheets for making storm sounds for example)
Jack Donovan Foley who started the movie "Foley" tradition picked up his trade in radio is a continuation of these practices. In radio you obviously can't see anything, so you have to communicate everything through sound, and sound effects freed up the story from having to narrate everything.
The gun sounds are interesting in that they are usually very wrong, but audiences expect them, and they help to communicate even they whey are inappropriate/wrong. For example you will hear the sound of a hammer being pulled back on many guns that done have hammers, or the sound if a gun being racked as someone sneaks through the house (which implies the gun was not fire-able before that moment, even though the actor was pointing it everywhere). One of my favorites is the sound if a double barrel coach shotgun being racked, when such a gun does not have a pump!