geekhack

geekhack Community => Keyboards => Topic started by: 680000 on Mon, 11 July 2016, 10:03:29

Title: How do diodes prevent ghosting/allow NKRO?
Post by: 680000 on Mon, 11 July 2016, 10:03:29
After doing a small amount of research on keyboards, I discovered key matrices. I also observed the usage of diodes to prevent some problems with keystroke recognition amongst people at this forum. However, I still don't understand how certain combinations of key-presses can be made to work by simply adding diodes.
This website was the easiest to comprehend, but I suspect there are some mistakes made in the graphics:
http://pcbheaven.com/wikipages/How_Key_Matrices_Works/
The image in concern is this. I have edited it a little to indicate the button I am concerned with. Three buttons, B2, B3 and C2, are already pressed. The button that will be pressed is the bottom-right one, C3. However, current would already be flowing through pins C and 3. How does the controller distinguish whether C3 has been pressed or not, and how do diodes make this possible? I know what they are, they allow current in one direction only.

Also, a bigger example, how would a controller distinguish whether the central (B2) key has been pressed if every other key (all the ones surrounding it) are already pressed?

I'm getting the feeling that I'm missing something very obvious...

EDIT: Added picture.
Title: Re: How do diodes prevent ghosting/allow NKRO?
Post by: CPTBadAss on Mon, 11 July 2016, 10:08:17
Komar posted this extensive link (http://blog.komar.be/how-to-make-a-keyboard-the-matrix/) on how matrices work. I think it's really informative.
Title: Re: How do diodes prevent ghosting/allow NKRO?
Post by: 680000 on Mon, 11 July 2016, 10:20:41
Komar posted this extensive link (http://blog.komar.be/how-to-make-a-keyboard-the-matrix/) on how matrices work. I think it's really informative.
I've been there. Yes it is really informative, but still doesn't seem to explain the problem, and especially the 3x3 example with all keys but the central one being pressed. I do understand some benefits of using diodes in keyboards, just not completely as it seems.
Also, whoops. I forgot to include the picture.
Title: Re: How do diodes prevent ghosting/allow NKRO?
Post by: chyros on Mon, 11 July 2016, 10:40:57
I made a video about exactly this that explains it in detail :) .

index=4
Title: Re: How do diodes prevent ghosting/allow NKRO?
Post by: Data on Mon, 11 July 2016, 14:41:53
I made a video about exactly this that explains it in detail :) .


Your videos are uniformly great.  No homo.  :)

So in the example 3x3 matrix with "N-key Rollover", the Zed (love it) key WOULD register because diodes.  But it didn't really take the explanation any further.  Is there any more to it than that?
Title: Re: How do diodes prevent ghosting/allow NKRO?
Post by: chyros on Mon, 11 July 2016, 16:46:24
I made a video about exactly this that explains it in detail :) .


Your videos are uniformly great.  No homo.  :)

So in the example 3x3 matrix with "N-key Rollover", the Zed (love it) key WOULD register because diodes.  But it didn't really take the explanation any further.  Is there any more to it than that?
There's no chance for it to ghost, so no reason for blocking. So the keyboard doesn't stop registering keys when a bunch are pressed, it just treats all inputs as valid.