The keyboard sends a scan code to the computer to the computer when each key is pressed. The computer itself determines what actual character this corresponds to. These codes are sent serially to the computer using a USB or PS2 serial connection. For more about these codes see:-

You could use a small microprocessor, like a PIC, and some buttons or digital inputs, that will send the required code when the button is pressed or the input is active.

Not too difficult to do if your computer has the older PS2 keyboard input. For a USB connection could be harder!

Another option would be to find an old computer keyboard, take it to bits, and use the electronics. The keys on a keyboard are multiplexed in a grid. You will have to find out which wires are connected together for the keys you want.

I made something similar,
a girl at work asked me if I could make a keyboard that would automatically type out all the characters, for those smiley faces and pictures for messenger service, using just the touch of one button.

She was just kidding, but I took it as a fun design challenge.

Here is what I came up with.

Was Not, yet finished, just at the final working stages, it has 10 buttons for 10 pictures.

I bought 2 cheap K-mart keyboards, one for taking apart and doing reverse engineering on it, and a second to do the actual prototype build.

Through testing I found that electrical signals was not the function, but rather mechanical connections, was how this worked.

So using reed relays, was the way to go with this.

Here is the circuit board in the keyboard, with wires that I soldered on to go to my circuitry.

Then the holes drilled thru keyboard and wires routed.

That was a lot of fun that I decided to design another one for myself this time, that would be portable, can be slid in and out of a connector to the keyboard, as a seperate module.

Here it is, in module form.

So it can be done, you just have to find out how your particular keyboard functions.