Converting Single And Double Keypresses To Characters - FIGnition FUZE Hardware Reference Manual

Table of Contents

Advertisement

So, the job of a computer keyboard is to filter out all the key-bounce without missing any
keys you intended to press. The way FIGnition does it is entirely in software. It reads the
keypad 50 times per second and if it sees the same set of keys being pressed at least
twice, it concludes that the key presses have settled down. This works, because key
bounce is <20ms so the scanning won't catch it twice. Also, a human being can't (nor-
mally) press keys at over 25 key presses per second, nor press a key for less than 40ms
when typing - it would be equivalent to a typing rate of over 200 words per minute.
In the FIGnition firmware, debounce is handled by the 'C' function
pares the previous keyscanning state with the new one and if they're the same, converts
the scan to a character.

2.2.4 Converting Single and Double Keypresses to Characters

On FIGnition key scanning doesn't directly generate characters, because we need to ana-
lyze pairs of keys in sequence. In fact there are quite a number of requirements for con-
verting characters:
• Recognizing which key has been pressed first, then second.
• Recognizing if a single key has been pressed for more than one second and displaying
the key layout prompt.
• Generating a repeat character if a pair of keys have been held down for 0.4s and 25
times per second thereafter. This provides a delay before keys repeat, and makes keys
repeat pretty quickly.
• Recognizing a key press, then a single key release followed by another key as another
keypress (you don't have to release both keys before pressing another key).
• Allowing the computer to execute code normally while all this is going on.
Approx 3ms
Fig 2.6
KeyScan
. It simply com-

Advertisement

Table of Contents
loading

Table of Contents