You can make use of
xdotool (xdotool: command-line X11 automation tool) to simulate the keyboard pressing.
The command for pressing ABCD together will be:
xdotool sleep 5 keydown a keydown b keydown c keydown d
It will first sleep 5 seconds for you to click to focus on the target program's window. Then it will press down a b c and d (not release them anymore).
After you would like to release these keys. Just kill the
xdotool instance by pressing Ctrl-C in the terminal.
Note: you will need to press abcd once again more on your keyboard to actually release these keys.