I realize this is a rather old thread, but...
One more sensing technique to add to the list - Inductive.
I was looking for a solution to sense when my Pella Slider footlocks were engaged. I ran across the following Inductive sensors: Inductive Proximity Sensor
The use a coil which senses a change in the resonant frequency when a metallic object is within view. I've tested them with a variety of metals (carbon steel to aluminum) and although the sensing distance changes, they will still switch. One of the things that I really like about these is that they are very "selective". I have an installation on my front door deadbolt where the sensor is surrounded by metal on three sides (metal doors with sidelites). It ignores the structure of the side panel and senses only the presence of the deadbolt.
For the footlocks, the sensor detects the metal pin when the footlock is in the engaged position. The sensor is small enough to allow me to mount it on the back (underside) of the footlock. It senses the metal pin through the plastic body, but is unaffected by the surrounding screws and mechanism.
These are available in both NPN and PNP outputs (I'm using both with the ELK-M1). My slider installs are over a year old now and I've had no issues (no adjustments or false reports).