SystemEventExt

Trait SystemEventExt 

Source
pub trait SystemEventExt {
    const Init: SystemEvent = SystemEvent::kEventInit;
    const InitLua: SystemEvent = SystemEvent::kEventInitLua;
    const Lock: SystemEvent = SystemEvent::kEventLock;
    const Unlock: SystemEvent = SystemEvent::kEventUnlock;
    const Pause: SystemEvent = SystemEvent::kEventPause;
    const Resume: SystemEvent = SystemEvent::kEventResume;
    const Terminate: SystemEvent = SystemEvent::kEventTerminate;
    const KeyPressed: SystemEvent = SystemEvent::kEventKeyPressed;
    const KeyReleased: SystemEvent = SystemEvent::kEventKeyReleased;
    const LowPower: SystemEvent = SystemEvent::kEventLowPower;
}

Provided Associated Constants§

Source

const Init: SystemEvent = SystemEvent::kEventInit

Program initialization.

After loading pdex.bin into memory, the system calls your event handler with this event.

Then you can supply your own run loop update function by calling System::set_update_callback or Update::set_update_handler here.

If you don’t provide an update callback, the system initializes a Lua context and calls your event handler again with event InitLua.

Source

const InitLua: SystemEvent = SystemEvent::kEventInitLua

Program initialization in lua context.

Source

const Lock: SystemEvent = SystemEvent::kEventLock

System going to locked state.

Source

const Unlock: SystemEvent = SystemEvent::kEventUnlock

System has been unlocked by user.

Source

const Pause: SystemEvent = SystemEvent::kEventPause

Program execution paused.

Source

const Resume: SystemEvent = SystemEvent::kEventResume

Program execution resumed after pause.

Source

const Terminate: SystemEvent = SystemEvent::kEventTerminate

Program termination.

Source

const KeyPressed: SystemEvent = SystemEvent::kEventKeyPressed

Simulator key is pressed.

When an arbitrary key is pressed in the Simulator your event handler is called with this event and the keycode of the key in the last argument.

See also KeyReleased.

Source

const KeyReleased: SystemEvent = SystemEvent::kEventKeyReleased

Simulator key is released.

When an arbitrary key is released in the Simulator your event handler is called with this event and the keycode of the key in the last argument.

See also KeyPressed.

Source

const LowPower: SystemEvent = SystemEvent::kEventLowPower

Low power warning by system.

At this point, it’s a good idea to persistently save anything you need, such as a save-game.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§