Patent attributes
A scanner for a keyboard device having a reflective surface for each key has a sensor associated with each key that includes an LED and a photo-transistor. The LED is turned ON for a first measurement, followed by a second measurement with the LED turned off, and a subtraction of the second measurement from the first yields an illumination value for a key x. The LEDs and associated photo-transistors are sequentially enabled in groups of n, thereby eliminating optical interference. Each key x has associated correction parameters of LinRest(x) associated with illumination value with the key in the rest (up) position, LinDown(x) associated with illumination value with the key in the down position, TrebErr(x) associated with the reflectivity effect of one adjacent key(x+1), and BassErr(x) associated with the reflectivity effect of another adjacent key(x−1). By reading a single illumination value in combination with these correction parameters, the key position may be accurately extracted and the effect of ambient light and surrounding key interference removed.