TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/mihaip/infinite-mac/llms.txt
Use this file to discover all available pages before exploring further.
EmbedControlEvent type, defined in src/embed-types.ts, describes every message payload you can send to an embedded Infinite Mac iframe via the postMessage API. Each event carries a type field that identifies the command, plus any additional fields required by that command.
Sending a control event
Obtain a reference to the iframe element and callpostMessage on its contentWindow. The second argument is the target origin — using "*" is convenient during development, but you should restrict it to "https://infinitemac.org" in production.
emulator_pause
Pauses CPU execution of the emulated machine. While paused the emulator stops consuming CPU time on the host, making it useful for conserving resources when the user is not interacting with the iframe — for example when it is scrolled out of view or hidden behind another element.
The companion paused=true and auto_pause=true URL parameters provide declarative alternatives; see URL Parameters for details.
No additional fields.
emulator_unpause
Resumes a previously paused emulator. Execution picks up exactly where it left off.
No additional fields.
emulator_mouse_move
Sends a mouse movement event to the emulated machine. The emulator backend determines whether absolute or relative coordinates are used.
Absolute X position in screen pixels. Used by emulators that support absolute
mouse coordinates: Mini vMac, Basilisk II, and SheepShaver.
Absolute Y position in screen pixels. Used by the same emulators as
x.Relative X delta in pixels. Used by emulators that require relative mouse
input: Previous, DingusPPC, and PearPC. Also used by
Basilisk II, SheepShaver, and Snow when the
useMouseDeltas
setting is enabled.Relative Y delta in pixels. Used by the same emulators as
deltaX.You should always send all four fields in every
emulator_mouse_move message.
The active emulator backend picks the coordinate system it understands and
ignores the other pair. For absolute-coordinate emulators (Mini vMac, Basilisk
II, SheepShaver) the x/y values are used; for relative-coordinate
emulators (Previous, DingusPPC, PearPC) the deltaX/deltaY values are
used. Basilisk II, SheepShaver, and Snow can optionally use relative
coordinates when useMouseDeltas is enabled in their settings.emulator_mouse_down / emulator_mouse_up
Sends a mouse button press or release to the emulated machine.
The mouse button to press or release.
| Value | Button |
|---|---|
0 | Left |
1 | Middle |
2 | Right |
emulator_key_down / emulator_key_up
Sends a physical key press or release to the emulated machine. The emulator translates the JavaScript key code into the appropriate ADB or platform-specific scancode.
A physical key code string matching the
KeyboardEvent.code
values defined by the W3C UI Events specification. These identify a key by its
physical position on the keyboard rather than the character it produces,
so they are layout-independent. Common examples: "KeyA", "Space",
"Enter", "ArrowLeft", "ShiftLeft", "MetaLeft", "Escape".The full mapping from JavaScript key codes to ADB and other platform
scancodes is in
src/emulator/common/key-codes.ts.
The full list of valid code strings is documented on
MDN.emulator_load_disk
Dynamically inserts a disk image into the running emulator at any point after boot, without requiring a restart.
The URL of an uncompressed disk image to load. Supported file types
include
.dsk, .img, .iso, and .toast. The URL must be accessible from
the emulator’s origin, so CORS headers are required for cross-origin images.emulator_load_disk is only supported by the Mini vMac, Basilisk II,
SheepShaver, and Previous emulators. Sending this event to a
DingusPPC, PearPC, or Snow-backed instance has no effect.