Trait GCDevicePhysicalInputState

Source
pub unsafe trait GCDevicePhysicalInputState: NSObjectProtocol {
    // Provided methods
    unsafe fn device(&self) -> Option<Retained<ProtocolObject<dyn GCDevice>>>
       where Self: Sized + Message { ... }
    unsafe fn lastEventTimestamp(&self) -> NSTimeInterval
       where Self: Sized + Message { ... }
    unsafe fn lastEventLatency(&self) -> NSTimeInterval
       where Self: Sized + Message { ... }
    unsafe fn elements(
        &self,
    ) -> Retained<GCPhysicalInputElementCollection<NSString, ProtocolObject<dyn GCPhysicalInputElement>>>
       where Self: Sized + Message { ... }
    unsafe fn buttons(
        &self,
    ) -> Retained<GCPhysicalInputElementCollection<NSString, ProtocolObject<dyn GCButtonElement>>>
       where Self: Sized + Message { ... }
    unsafe fn axes(
        &self,
    ) -> Retained<GCPhysicalInputElementCollection<NSString, ProtocolObject<dyn GCAxisElement>>>
       where Self: Sized + Message { ... }
    unsafe fn switches(
        &self,
    ) -> Retained<GCPhysicalInputElementCollection<NSString, ProtocolObject<dyn GCSwitchElement>>>
       where Self: Sized + Message { ... }
    unsafe fn dpads(
        &self,
    ) -> Retained<GCPhysicalInputElementCollection<NSString, ProtocolObject<dyn GCDirectionPadElement>>>
       where Self: Sized + Message { ... }
    unsafe fn objectForKeyedSubscript(
        &self,
        key: &NSString,
    ) -> Option<Retained<ProtocolObject<dyn GCPhysicalInputElement>>>
       where Self: Sized + Message { ... }
}
Available on crate feature GCDevicePhysicalInputState only.
Expand description

An object conforming to GCDevicePhysicalInputStatecontains the state of a device’s physical inputs. This may be either the “live” physical input state if the same object also conforms to GCDevicePhysicalInput,or a snapshot of the physical input state.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn device(&self) -> Option<Retained<ProtocolObject<dyn GCDevice>>>
where Self: Sized + Message,

Available on crate feature GCDevice only.

The device that this profile is mapping input from.

Source

unsafe fn lastEventTimestamp(&self) -> NSTimeInterval
where Self: Sized + Message,

The internal time stamp of the last event.

This time interval is not relative to any specific point in time. Your application can subtract a previous timestamp from the returned timestamp to determine the time (in seconds) between events. The lastEventTimestampof the inputs from two different devices can be compared to determine which event occurred first.

Source

unsafe fn lastEventLatency(&self) -> NSTimeInterval
where Self: Sized + Message,

The interval (in seconds) between the timestamp of the last event and the current time.

This value should be treated as a lower bound of the event latency. It may not include (wired or wireless) transmission latency, or latency accrued on the device before the event was transmitted to the host.

Note: If the system has gone to sleep between when the event occurred and when this property is read, the returned value may not reflect the true latency.

Source

unsafe fn elements( &self, ) -> Retained<GCPhysicalInputElementCollection<NSString, ProtocolObject<dyn GCPhysicalInputElement>>>
where Self: Sized + Message,

Available on crate features GCInputNames and GCPhysicalInputElement only.

The following properties allow for runtime lookup of any input element on a profile, when provided with a valid alias.

Source

unsafe fn buttons( &self, ) -> Retained<GCPhysicalInputElementCollection<NSString, ProtocolObject<dyn GCButtonElement>>>
where Self: Sized + Message,

Available on crate features GCButtonElement and GCInputNames and GCPhysicalInputElement only.
Source

unsafe fn axes( &self, ) -> Retained<GCPhysicalInputElementCollection<NSString, ProtocolObject<dyn GCAxisElement>>>
where Self: Sized + Message,

Available on crate features GCAxisElement and GCInputNames and GCPhysicalInputElement only.
Source

unsafe fn switches( &self, ) -> Retained<GCPhysicalInputElementCollection<NSString, ProtocolObject<dyn GCSwitchElement>>>
where Self: Sized + Message,

Available on crate features GCInputNames and GCPhysicalInputElement and GCSwitchElement only.
Source

unsafe fn dpads( &self, ) -> Retained<GCPhysicalInputElementCollection<NSString, ProtocolObject<dyn GCDirectionPadElement>>>
where Self: Sized + Message,

Available on crate features GCDirectionPadElement and GCInputNames and GCPhysicalInputElement only.
Source

unsafe fn objectForKeyedSubscript( &self, key: &NSString, ) -> Option<Retained<ProtocolObject<dyn GCPhysicalInputElement>>>
where Self: Sized + Message,

Available on crate feature GCPhysicalInputElement only.

Profile elements can be accessed using keyed subscript notation, with a valid alias of its inputs.

Note: Equivalent to -elements

Trait Implementations§

Source§

impl ProtocolType for dyn GCDevicePhysicalInputState

Source§

const NAME: &'static str = "GCDevicePhysicalInputState"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn GCDevicePhysicalInputState

Implementations on Foreign Types§

Source§

impl<T> GCDevicePhysicalInputState for ProtocolObject<T>

Implementors§

Source§

impl GCDevicePhysicalInputState for GCControllerInputState

Available on crate feature GCControllerInput only.
Source§

impl GCDevicePhysicalInputState for GCControllerLiveInput

Available on crate feature GCControllerInput only.
Source§

impl GCDevicePhysicalInputState for GCRacingWheelInput

Available on crate feature GCRacingWheelInput only.
Source§

impl GCDevicePhysicalInputState for GCRacingWheelInputState

Available on crate feature GCRacingWheelInput only.