Trait GCRelativeInput

Source
pub unsafe trait GCRelativeInput: NSObjectProtocol {
    // Provided methods
    unsafe fn deltaDidChangeHandler(
        &self,
    ) -> *mut DynBlock<dyn Fn(NonNull<ProtocolObject<dyn GCPhysicalInputElement>>, NonNull<ProtocolObject<dyn GCRelativeInput>>, c_float)>
       where Self: Sized + Message { ... }
    unsafe fn setDeltaDidChangeHandler(
        &self,
        delta_did_change_handler: Option<&DynBlock<dyn Fn(NonNull<ProtocolObject<dyn GCPhysicalInputElement>>, NonNull<ProtocolObject<dyn GCRelativeInput>>, c_float)>>,
    )
       where Self: Sized + Message { ... }
    unsafe fn delta(&self) -> c_float
       where Self: Sized + Message { ... }
    unsafe fn isAnalog(&self) -> bool
       where Self: Sized + Message { ... }
    unsafe fn lastDeltaTimestamp(&self) -> NSTimeInterval
       where Self: Sized + Message { ... }
    unsafe fn lastDeltaLatency(&self) -> NSTimeInterval
       where Self: Sized + Message { ... }
    unsafe fn sources(
        &self,
    ) -> Retained<NSSet<ProtocolObject<dyn GCPhysicalInputSource>>>
       where Self: Sized + Message { ... }
}
Available on crate feature GCRelativeInput only.
Expand description

An object conforming to GCRelativeInputrepresents an input that reports its change in position along an axis (delta) since the previous event. Relative inputs have no fixed origin from which a coordinate syatem can be defined.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn deltaDidChangeHandler( &self, ) -> *mut DynBlock<dyn Fn(NonNull<ProtocolObject<dyn GCPhysicalInputElement>>, NonNull<ProtocolObject<dyn GCRelativeInput>>, c_float)>
where Self: Sized + Message,

Available on crate features GCPhysicalInputElement and block2 only.

Set this block to be notified when the delta of the input changes.

Parameter delta: The amount that the input has changed since the last time deltaDidChangeHandlerfired.

Source

unsafe fn setDeltaDidChangeHandler( &self, delta_did_change_handler: Option<&DynBlock<dyn Fn(NonNull<ProtocolObject<dyn GCPhysicalInputElement>>, NonNull<ProtocolObject<dyn GCRelativeInput>>, c_float)>>, )
where Self: Sized + Message,

Available on crate features GCPhysicalInputElement and block2 only.
Source

unsafe fn delta(&self) -> c_float
where Self: Sized + Message,

The last reported delta for the input.

Source

unsafe fn isAnalog(&self) -> bool
where Self: Sized + Message,

Check if the input can support more than just digital values.

Defaults to YESfor most relative inputs.

Source

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

The timestamp of the last change.

This time interval is not relative to any specific point in time. You can subtract a previous timestamp from the current timestamp to determine the time (in seconds) between changes to the value.

Source

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

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

This 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.

Source

unsafe fn sources( &self, ) -> Retained<NSSet<ProtocolObject<dyn GCPhysicalInputSource>>>
where Self: Sized + Message,

Available on crate feature GCPhysicalInputSource only.

An object describing the physical action(s) the user performs to manipulate this input.

Trait Implementations§

Source§

impl ProtocolType for dyn GCRelativeInput

Source§

const NAME: &'static str = "GCRelativeInput"

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 GCRelativeInput

Implementations on Foreign Types§

Source§

impl<T> GCRelativeInput for ProtocolObject<T>
where T: ?Sized + GCRelativeInput,

Implementors§