A system, method, and computer-readable medium having instructions for
determining a key press from a current keyboard state at a current time
is described. The system stores signals indicative of a last key press, a
last key press time, and a last keyboard state. The system determines
released keys and pressed keys on the keyboard at the current time based
on comparison with the last keyboard state. The system determines a key
press at the current time if the first determination determines a single
key press and if either of: (a) a match exists between the determined key
press and the last key pressed and if the elapsed time between the
current time and the last key press time is larger than a preset bounce
time; and (b) a match does not exist between the determined key press and
the last key press.