A method of detecting a contactless gesture on an electronic device, the electronic device having an electromagnetic radiation transmitter (105a, 105b, 105c, 105d) and an electromagnetic radiation receiver, the electromagnetic radiation receiver configured for receiving electromagnetic radiation emitted from the electromagnetic radiation transmitter (105a, 105b, 105c, 105d) and reflected by an object, the method comprising: monitoring an amplitude of received electromagnetic radiation at the electromagnetic radiation receiver; detecting a proximity event by comparing the amplitude to a predetermined proximity threshold; after detecting the proximity event, continuing to monitor the amplitude of the received electromagnetic radiation at the electromagnetic radiation receiver; and, in response to detecting the proximity event, and while it is determined that an object remains in proximity, performing an analysis on the received electromagnetic radiation to determine whether the received electromagnetic radiation indicates a predetermined gesture, the analysis comprising: detecting a peak amplitude event based on the amplitudes of the received electromagnetic radiation monitored after the proximity event; the gesture analysis being characterised in that it further comprises: determining a first incline representing an average rate of change of the amplitude of received electromagnetic radiation during a period preceding the peak amplitude event; determining a second incline representing an average rate of change of the amplitude of received electromagnetic radiation during a period subsequent to the peak amplitude event; and comparing the first incline and the second incline to one or more predetermined incline thresholds. monitoring an amplitude of received electromagnetic radiation at the electromagnetic radiation receiver; detecting a proximity event by comparing the amplitude to a predetermined proximity threshold; after detecting the proximity event, continuing to monitor the amplitude of the received electromagnetic radiation at the electromagnetic radiation receiver; and, in response to detecting the proximity event, and while it is determined that an object remains in proximity, performing an analysis on the received electromagnetic radiation to determine whether the received electromagnetic radiation indicates a predetermined gesture, the analysis comprising: detecting a peak amplitude event based on the amplitudes of the received electromagnetic radiation monitored after the proximity event; the gesture analysis being characterised in that it further comprises: determining a first incline representing an average rate of change of the amplitude of received electromagnetic radiation during a period preceding the peak amplitude event; determining a second incline representing an average rate of change of the amplitude of received electromagnetic radiation during a period subsequent to the peak amplitude event; and comparing the first incline and the second incline to one or more predetermined incline thresholds. detecting a peak amplitude event based on the amplitudes of the received electromagnetic radiation monitored after the proximity event; the gesture analysis being characterised in that it further comprises: determining a first incline representing an average rate of change of the amplitude of received electromagnetic radiation during a period preceding the peak amplitude event; determining a second incline representing an average rate of change of the amplitude of received electromagnetic radiation during a period subsequent to the peak amplitude event; and comparing the first incline and the second incline to one or more predetermined incline thresholds.