XPLMKeySniffer_f

Type Alias XPLMKeySniffer_f 

Source
pub type XPLMKeySniffer_f = Option<unsafe extern "C" fn(inChar: c_char, inFlags: XPLMKeyFlags, inVirtualKey: c_char, inRefcon: *mut c_void) -> c_int>;
Expand description

XPLMKeySniffer_f

This is the prototype for a low level key-sniffing function. Window-based UI should not use this! The windowing system provides high-level mediated keyboard access, via the callbacks you attach to your XPLMCreateWindow_t. By comparison, the key sniffer provides low level keyboard access.

Key sniffers are provided to allow libraries to provide non-windowed user interaction. For example, the MUI library uses a key sniffer to do pop-up text entry.

Return 1 to pass the key on to the next sniffer, the window manager, X-Plane, or whomever is down stream. Return 0 to consume the key.

Warning: this API declares virtual keys as a signed character; however the VKEY #define macros in XPLMDefs.h define the vkeys using unsigned values (that is 0x80 instead of -0x80). So you may need to cast the incoming vkey to an unsigned char to get correct comparisons in C.

Aliased Type§

pub enum XPLMKeySniffer_f {
    None,
    Some(unsafe extern "C" fn(i8, i32, i8, *mut c_void) -> i32),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(i8, i32, i8, *mut c_void) -> i32)

Some value of type T.