retro_keyboard_event_t

Type Alias retro_keyboard_event_t 

Source
pub type retro_keyboard_event_t = Option<unsafe extern "C" fn(down: bool, keycode: c_uint, character: u32, key_modifiers: u16)>;
Expand description

Callback type passed in RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK. Called by the frontend in response to keyboard events. down is set if the key is being pressed, or false if it is being released. keycode is the RETROK value of the char. character is the text character of the pressed key. (UTF-32). key_modifiers is a set of RETROKMOD values or’ed together.

The pressed/keycode state can be indepedent of the character. It is also possible that multiple characters are generated from a single keypress. Keycode events should be treated separately from character events. However, when possible, the frontend should try to synchronize these. If only a character is posted, keycode should be RETROK_UNKNOWN.

Similarily if only a keycode event is generated with no corresponding character, character should be 0.

Aliased Type§

pub enum retro_keyboard_event_t {
    None,
    Some(unsafe extern "C" fn(bool, u32, u32, u16)),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(bool, u32, u32, u16))

Some value of type T.