1/4th of an inch.
That is the distance you would have to move your finger in order to reach the caps lock button.
Use the debugger, step through the program.
Also, have the program output variables on each loop so you can see what they're doing.
Then you should get a better idea of what the program is doing, as the function isn't very descriptive of itself.