I’ve just posted a script that will re-route the OSX Apple Remote event stream out across XMPP using the Switchboard Ruby library, streaming click-down and click-up events from the device out to any endpoint identified by a Jabber/XMPP JID (i.e. Jabber ID). In my case, I’m connecting to XMPP as the user xmpp:email@example.com, who is buddies with xmpp:firstname.lastname@example.org, ie. they are on each other’s Jabber rosters already. Currently I simply send a textual message with the button-press code; a real app would probably use an XMPP IQ stanza instead, which is oriented more towards machines than human readers.
Here’s sample output of the script (local copy but it looks the same remotely), in which I press and release quickly every button in turn:
Cornercase:osx danbri$ ./buttonhole_surfer.rb starting event loop. => Switchboard started. ButtonDownEvent: PLUS (0x1d) ButtonUpEvent: PLUS (0x1d) ButtonDownEvent: MINU (0x1e) ButtonUpEvent: MINU (0x1e) ButtonDownEvent: LEFT (0x17) ButtonUpEvent: LEFT (0x17) ButtonDownEvent: RIGH (0x16) ButtonUpEvent: RIGH (0x16) ButtonDownEvent: PLPZ (0x15) ButtonUpEvent: PLPZ (0x15) ButtonDownEvent: MENU (0x14) ButtonUpEvent: MENU (0x14) ^C Shutdown initiated. Waiting for shutdown to complete. Shutdown initiated. Waiting for shutdown to complete. Cornercase:osx danbri$