The simplest way to pass a specific event between two processes it to use process-wait-for-event on the receiving process, and process-send on the sender side. The "event" that is passed is can be any Lisp object.
process-send and process-wait-for-event use a
to pass the object (the process-mailbox of the receiver). It is possible to use a
object directly, and to communicate between multiple senders and receivers. Use make-mailbox to make a mailbox, and mailbox-send to put a message in it. The receiver(s) use either mailbox-wait-for-event and mailbox-read.
mailbox-wait-for-event should be used on processes that may make windows (including any process associated with a CAPI interface), but can be used elsewhere. mailbox-read is faster, but if it used on a process with a window it may cause hanging.
process-wait-for-event and process-send and
are the primary interface for communication between processes, and should be used unless there is a very good reason to use a different mechanism.