Your scheme is essentially same as is used by keyboards and has the same problem. When you press two keys that are connected to same output wire, additional keys on these two inputs are ambiguous. There are some software tricks related to the fact that nobody presses multiple keys at exactly same time, but the root problem still exists.
But there are no two keys connected to the same output wire at the same time. If I put the value:
00100000
onto the input register, and I get:
01000000
on the output register, that can only correspond to one key at the time I read the register.
EDIT: I think perhaps you're underestimating how quickly a microcontroller can scan a keyboard. If I press 2 keys simultaneously that are both connected to the same output pin on the output register at different times, the rate at which I scan the input register is so fast that it would be physically impossible for me not to detect that as 2 distinct keys being pressed.
The problem happens when you press three or more keys at once in right combination. And is exactly the same regardless whether you scan output wires in sequence (as is done in simple hardware based keyboards of the 70's and 80's) or if you read them all at once.
Going back to your original example, if one would press keys 1, 2 and 6 at the same time your microcontroller would falsely detect 7 as being also pressed (because keys 1 and 6 shorts two input wires together). This assuming that your output register drives strong 1 and weak (preferably floating) 0. If it has strong drive for both 0 and 1, then such combination of pressed keys would cause some unpredictable effect, possibly including burning out the pins.
If I put a voltage on pin 2, and key A is pressed, I will get a voltage at pin 1. If I put a voltage on pin 3 and key B is pressed, I will get a voltage at pin 1.
It doesn't matter if both are pressed simultaneously because I am reading them sequentially.
All you have to do is scan the keys quickly enough that someone can't "sneak in" a key press in between scans which turns out is possible with even the lowest powered hardware.
Ghosting is with three keys pressed: If there is a key A that is in the same row as a key B plus and also in the same column as a key C, then a fourth key (the 'ghost') appears to be pressed in the column of key B and the row of key C due to the shorting of the rows and columns, also in your scheme.
There are no columns in this design. The behaviour you're describing can't occur since this isn't a 2d matrix of keys. The keys are grouped such that putting voltage on an input pin will result in an output voltage on many pins depending on which keys are pressed at the time.