TOP

Mantle Events

Mantle assumes all software running in user-space is event-driven. Events are described in messages, which are parameters passed to a single event handler for dispatching.

When an event handler is invoked, register a0 holds the message type. Register a1 holds a timestamp, providing an indication of when the event happened, while register a2 holds a dword which is unique to the kind of event being processed.

Message Types

Message Type Value Kind of Message
mtInit 0 Initialize program. Called exactly once.
mtKeyDown 1 User pressed a key on the keyboard.
mtKeyUp 2 User released a key on the keyboard.
mtTimerTick 3 A timer has expired.
mtMouse 4 User moved the mouse, pressed a button, or released a button.