Author Topic: How do diodes prevent ghosting/allow NKRO?  (Read 5952 times)

0 Members and 1 Guest are viewing this topic.

Offline 680000

  • Thread Starter
  • Posts: 6
How do diodes prevent ghosting/allow NKRO?
« 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.
« Last Edit: Mon, 11 July 2016, 10:21:59 by 680000 »

Offline CPTBadAss

  • Woke up like this
  • Posts: 14365
    • Tactile Zine
Re: How do diodes prevent ghosting/allow NKRO?
« Reply #1 on: Mon, 11 July 2016, 10:08:17 »
Komar posted this extensive link on how matrices work. I think it's really informative.

Offline 680000

  • Thread Starter
  • Posts: 6
Re: How do diodes prevent ghosting/allow NKRO?
« Reply #2 on: Mon, 11 July 2016, 10:20:41 »
Komar posted this extensive link 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.

Offline chyros

  • a.k.a. Thomas
  • * Esteemed Elder
  • Posts: 3477
  • Location: The Netherlands
  • Hello and welcome.
Re: How do diodes prevent ghosting/allow NKRO?
« Reply #3 on: Mon, 11 July 2016, 10:40:57 »
I made a video about exactly this that explains it in detail :) .

index=4
Check my keyboard video reviews:


Offline Data

  • Posts: 2608
  • Location: Orlando, FL
Re: How do diodes prevent ghosting/allow NKRO?
« Reply #4 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?

Offline chyros

  • a.k.a. Thomas
  • * Esteemed Elder
  • Posts: 3477
  • Location: The Netherlands
  • Hello and welcome.
Re: How do diodes prevent ghosting/allow NKRO?
« Reply #5 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.
Check my keyboard video reviews: