Let say F7 is bound, in emacs, to the org-clock-out function of Org Mode as a shortcut to quickly stop the current clock accumulating the time spent on a given task.
(global-set-key (kbd "<f7>") 'org-clock-out)
F7 can be sent to the emacs window via the command line with
xdotool search --name 'emacs@fold' key F7
If emacs needs to be displayed to the user (in case it was iconified or on another desktop), the windowactivate command can be added:
xdotool search --name 'emacs@fold' windowactivate key F7
On Ubuntu 14.04 this command can be bound to the F7 regardless of which window has focus, via the shortcuts tab of the keyboard section of System Settings as shown below: