While in theory you could get something like that to work (although, I wouldn’t try that exact circuit you are suggesting - that would probably cause problems); have you thought about other options?
Set up the Arduino as a USB host (you have to build a shield or something with an extra USB connector), and emulate the keyboard HID device (this wouldn’t be easy - and may not even be possible within the limits of the Arduino, but if you look up OrdDuino, you can see someone who did it for serial-port joystick-like devices).
Do you have a PS/2 keyboard port on your computer? If you do, there have been several projects done for other microcontrollers (Basic Stamp, PIC, etc) that emulated a PS/2 keyboard - this might be a good option.
Use the Arduino to fire solenoids which hit the keys; ok - I’m not serious on this one, but it would be an interesting project nonetheless!
Without knowing some specifics of the keyboard controller chipset in question, it would be difficult to know how to properly create a transistor-based switch for the key matrix, but it definitely could be done. Maybe you should let us know what kind of keyboard IC is being looked at (are you looking at a bare IC from a distributor - or are you going to hack an existing keyboard?).
Also, on the transistor in your example, you would want a resistor between the base and the Arduino pin (about 1K); this controls current thru the transistor - without it, you might either burn out the Arduino, the transistor, or both.