First Open the Remote Desktop application located in /Application/Remote Desktop. Next select the computer you want to send the keystrokes to.
Type in the following, replacing the quoted text after “keystroke”. In this example this will type “Text To Send” on the destination computer(s).
osascript -e 'tell application "System Events" to keystroke "Text To Send"'
If no one is logged in to the computer you will need to modify the “Run Command as:” option. You will have to choose a User, you can type in the local administrator to the computer or “root”.