Dave Dunfield wrote:
Because for a parallel keyboard you need a key-down
strobe. If you just
set the strobe on keydown and clear it on key up, you will not correctly
perform rollover - If you are unfamilier with the term, rollover describes
True, I strobe on keydown, I don't hold the strobe down for more than 1uS.
One way to resolve this is to simply "pulse"
key-down, and not hold it down
while keys are down - this works for most applications, but not for some
games and things which actually use the duration of key-down.
Yes, this is how I do it.
If you take this approach, you can ignore key-up
codes, and simply write
the ASCII value to the parallel port on key-down codes, and strobe the
key-down signal on the parallel interface - but you still have to queue
data from the keyboard because you cannot process the next key until
after you have released key-down on the parallel interface.
I still don't understand this. The strobe period is typically 1uS, so
there is no chance a new PS/2 char could arrive before I finish my strobe.
was actually pressed (hence "two key"
rollover). This type of keyboard
also usually output a key-down strobe for as long as the key is held
Yes, if that is the requirement, then I'd need more code to handle that.
Fancier keyboards feature 'n' key rollover,
which means the scanner
runs all the time, and keystrokes are queued so that any number of
pending keys can be serviced. These typically have only a key strobe
output, so that the queue can be emptied to "keep up" with the guy
mashing down keys.
This is how I have implemented my interface. THe PS/2 keyboard standard
is an 'n' key rollover implementation, so I just grab the scan code and
convert to ASCII, strobing it into the parallel latch and then repeating
the process.
Yes they do, but they only repeat the key-down code -
you need to maintain
your own repeat logic if you want to be able to toggle the key-down strobe
while keys are held down (just asserting it again won't make it toggle).
When you just strobe on keydown, when the next keydown comes along on
PS/2, I just treat it like a new character.
I would agree you can implement that logic internal (Since C=Key can
also interfaces a KB matrix to PS/2, I implemented a full n-key rollover
scanner with repeat), I decided against re-implementing something
already in PS/2 KBs.
Jim
--
Jim Brain, Brain Innovations (X)
brain at
jbrain.com
Dabbling in WWW, Embedded Systems, Old CBM computers, and Good Times!
Home:
http://www.jbrain.com