For macOS, we'll have to do this via objective-c so would be the lower-level function that would post the event.

On Tue, Feb 4, 2025 at 10:42 AM Michael Albinus <michael.albinus@gmx.de> wrote:
Ship Mints <shipmints@gmail.com> writes:

> This would be kbd_buffer_store_event?

On Lisp level, adding the event to unread-command-events, as Eli
said. See a similar handling in dbus-call-method.

>     What I had in mind is basically to have the D-Bus handler push a
>     special event onto unread-command-events, and then that event
>     could be
>     bound to a command.

Best regards, Michael.