How to simulate key press

I have a digital scale which has a keyboard.
The keyboard has 32 ksys which a set of 4 X 8 wires catch the pressed key.
As you now when user presses one of the 32 keys, one of X wires and one of Y wires are shortcuted.
My problem is that using an arduino mega 2560 how can I make a sbrtcut for a few milliseconds as if the key has been preesed by user.

Thanks

Are you trying to detect when a particular key is pressed or when any key is pressed ?

I need to simulate all 32 keys. In fact, 4x8 key wires go to arduino as input and then I want to create key presses programmaticaly on scale input pins.

moham14:
I have a digital scale which has a keyboard.
The keyboard has 32 ksys which a set of 4 X 8 wires catch the pressed key.
As you now when user presses one of the 32 keys, one of X wires and one of Y wires are shortcuted.
My problem is that using an arduino mega 2560 how can I make a sbrtcut for a few milliseconds as if the key has been preesed by user.

Thanks

With most any Arduino you can use:

Otherwise the Arduino Micro and Leonardo (possibly the Due) and a few compatible boards have chips with built-in USB. Those can run as HID that the PC sees as game controller/keyboard.

I believe you are asking how to fake the key presses to the scale, ie pretend to be the keypad.

This can usually be done using a transistor in place of each key, but you need to find out the voltages
on the wires (typically one set will be pulled either high or low in turn to sense the array, and we need
to know which, and which way). The average voltage as measured by a multimeter will give a good clue,
use of a 'scope is ideal...

when i connect for example x.2 to y.4 by a wire, digital scale assumes that user has pressed key (number 5)

I am looking for a wsy to do this by arduino.

Is it possible?