Date : Tue, 29 Jun 2010 23:57:07 +0100
From : pete@... (Pete Turnbull)
Subject: BBC Master Compact key ghosting
On 29/06/2010 22:58, samwise wrote:
> Does a real BBC ghost in that way too? Paul has looked at the PCB and
> the schematic for the Master Compact and can't see any diodes or
> anything like that so it seems that it must have ghosting. The
> question is how does it deal with it. There are three potential
> options:
>
> 1. Ignore it, allow ghosting
> 2. Prevent ghosting by not reporting newly pressed keys when it happens
> 3. Lock up until keys are released
>
> The PC USB keyboard does (3), and currently it looks like the BBC
> keyboard does (1).
As Jonathan wrote, the ghosting is a consequence of the keyboard wiring
and is a real effect. There are a few keyboard designs that use lots of
diodes to prevent or minimise that (Beeb keyboards use diodes on SHIFT
and CTRL), but in most cases some software somewhere performs rollover
and lockout -- often "2-key rollover with n-key lockout".
What that amounts to relies on the fact that it's virtually impossible
to hit two or more keys absolutely simultaneously, so when a keypress is
detected, it's remembered, if a second keypress is detected it too is
remembered (that's the 2-key rollover) but anything else is ignored
(n-key lockout) until at least one is released.
In a PC keyboard, the microcontroller in the keyboard does that under
control of its firmware, whereas in a Beeb it's done by the 6502 under
control of the MOS. It's just basic keyboard handling and you'll find
the same algorithms in gazillions of systems if you dig deep enough.
Of course, anything that polls the keyboard directly, bypassing the MOS,
will have to decide for itself what to do. On USB, PS/2, or similar
keyboards, you don't have that option; only the keyboard firmware writer
does. Paul is in the position of that firmware writer.
--
Pete Peter Turnbull
Network Manager
University of York