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 { ... }
}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§
Sourceunsafe fn deltaDidChangeHandler(
&self,
) -> *mut DynBlock<dyn Fn(NonNull<ProtocolObject<dyn GCPhysicalInputElement>>, NonNull<ProtocolObject<dyn GCRelativeInput>>, c_float)>
Available on crate features GCPhysicalInputElement and block2 only.
unsafe fn deltaDidChangeHandler( &self, ) -> *mut DynBlock<dyn Fn(NonNull<ProtocolObject<dyn GCPhysicalInputElement>>, NonNull<ProtocolObject<dyn GCRelativeInput>>, c_float)>
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.
§Safety
- The returned block’s argument 1 must be a valid pointer.
- The returned block’s argument 2 must be a valid pointer.
Sourceunsafe fn setDeltaDidChangeHandler(
&self,
delta_did_change_handler: Option<&DynBlock<dyn Fn(NonNull<ProtocolObject<dyn GCPhysicalInputElement>>, NonNull<ProtocolObject<dyn GCRelativeInput>>, c_float)>>,
)
Available on crate features GCPhysicalInputElement and block2 only.
unsafe fn setDeltaDidChangeHandler( &self, delta_did_change_handler: Option<&DynBlock<dyn Fn(NonNull<ProtocolObject<dyn GCPhysicalInputElement>>, NonNull<ProtocolObject<dyn GCRelativeInput>>, c_float)>>, )
GCPhysicalInputElement and block2 only.Setter for deltaDidChangeHandler.
This is copied when set.
Sourceunsafe fn isAnalog(&self) -> bool
unsafe fn isAnalog(&self) -> bool
Check if the input can support more than just digital values.
Defaults to
YESfor most relative inputs.
Sourceunsafe fn lastDeltaTimestamp(&self) -> NSTimeInterval
unsafe fn lastDeltaTimestamp(&self) -> NSTimeInterval
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.
Sourceunsafe fn lastDeltaLatency(&self) -> NSTimeInterval
unsafe fn lastDeltaLatency(&self) -> NSTimeInterval
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.
Sourceunsafe fn sources(
&self,
) -> Retained<NSSet<ProtocolObject<dyn GCPhysicalInputSource>>>
Available on crate feature GCPhysicalInputSource only.
unsafe fn sources( &self, ) -> Retained<NSSet<ProtocolObject<dyn GCPhysicalInputSource>>>
GCPhysicalInputSource only.An object describing the physical action(s) the user performs to manipulate this input.