GuyDads was right when he answered my trivia yesterday that the black hanky is for S&M, and the right pocket is the bottom, submissive, or passive partner. The Hanky Code is a traditional form of signaling to others what your sexual preferences and interests are. Gay men used this code to communicate with each other in the noisy and distracting environment of gay bars. Although not as widely used these days, it is still a worthwhile resource and is, among those who know, a great conversation starter. Hankies can also be worn around the wrist, ankle, or leg (at the thigh, above the knee), or around the neck with the tie going either right or left. Other objects such as keys, key chains, watch fobs, or even handcuffs can also be used to let people know if you're a "top" or "bottom." If worn in the back on the center belt loop, it translates as "versatile."
The wearing of various colored bandanas around the neck was common in the mid- and late-nineteenth century among cowboys, steam railroad engineers, and miners in the Western United States. It is thought that the wearing of bandanas by gay men originated in San Francisco after the Gold Rush, when, because of a shortage of women, men dancing with each other in square dances developed a code wherein the man wearing the blue bandana took the male part in the square dance, and the man wearing the red bandana took the female part (these bandanas were usually worn around the arm or hanging from the belt or in the back pocket of one's jeans). It is thought that the modern hanky code started in New York City when a Village Voice journalist is credited with the birth of the modern hanky code in 1970, jokingly suggesting that instead of wearing keys to indicate whether someone was a top or a bottom, it would be more effective to announce a particular sexual desire by wearing different colored hankies in their back pockets. There were only a few colors suggested—red, navy, light blue, green and black—because that was all that Levi’s produced at the time.
Today, wearing color-coded handkerchiefs (bandanas) is the manner in which communication of desires and fetishes is achieved. Wearing a handkerchief on the left side of the body typically indicates one is a "top" (one considered active in the practice of the fetish indicated by the color of the handkerchief), while wearing it on the right side of the body would indicate one is a "bottom" (one considered passive in the practice of the fetish indicated by the color of the handkerchief). This left-right reality is taken from the earlier practice of tops wearing their keys on the left belt loop and bottoms on the right to indicate being a member of the leather subculture. Bandanas might be worn in the front or back pocket, tied around the neck (with the knot positioned on either the left or right side); around the ankle (when wearing boots or when undressed); or on other parts of the body.