pub unsafe trait GCTouchedStateInput: NSObjectProtocol {
// Provided methods
unsafe fn touchedDidChangeHandler(
&self,
) -> *mut DynBlock<dyn Fn(NonNull<ProtocolObject<dyn GCPhysicalInputElement>>, NonNull<ProtocolObject<dyn GCTouchedStateInput>>, Bool)>
where Self: Sized + Message { ... }
unsafe fn setTouchedDidChangeHandler(
&self,
touched_did_change_handler: Option<&DynBlock<dyn Fn(NonNull<ProtocolObject<dyn GCPhysicalInputElement>>, NonNull<ProtocolObject<dyn GCTouchedStateInput>>, Bool)>>,
)
where Self: Sized + Message { ... }
unsafe fn isTouched(&self) -> bool
where Self: Sized + Message { ... }
unsafe fn lastTouchedStateTimestamp(&self) -> NSTimeInterval
where Self: Sized + Message { ... }
unsafe fn lastTouchedStateLatency(&self) -> NSTimeInterval
where Self: Sized + Message { ... }
unsafe fn sources(
&self,
) -> Retained<NSSet<ProtocolObject<dyn GCPhysicalInputSource>>>
where Self: Sized + Message { ... }
}
GCTouchedStateInput
only.Expand description
An object conforming to
GCTouchedStateInput
represents the touched state of
an element.
Some buttons feature capacitive touch capabilities, where the user can touch the button without pressing it. In such cases, a button can be touched without being pressed.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn touchedDidChangeHandler(
&self,
) -> *mut DynBlock<dyn Fn(NonNull<ProtocolObject<dyn GCPhysicalInputElement>>, NonNull<ProtocolObject<dyn GCTouchedStateInput>>, Bool)>
Available on crate features GCPhysicalInputElement
and block2
only.
unsafe fn touchedDidChangeHandler( &self, ) -> *mut DynBlock<dyn Fn(NonNull<ProtocolObject<dyn GCPhysicalInputElement>>, NonNull<ProtocolObject<dyn GCTouchedStateInput>>, Bool)>
GCPhysicalInputElement
and block2
only.Set this block if you want to be notified when the touched state changes.
Sourceunsafe fn setTouchedDidChangeHandler(
&self,
touched_did_change_handler: Option<&DynBlock<dyn Fn(NonNull<ProtocolObject<dyn GCPhysicalInputElement>>, NonNull<ProtocolObject<dyn GCTouchedStateInput>>, Bool)>>,
)
Available on crate features GCPhysicalInputElement
and block2
only.
unsafe fn setTouchedDidChangeHandler( &self, touched_did_change_handler: Option<&DynBlock<dyn Fn(NonNull<ProtocolObject<dyn GCPhysicalInputElement>>, NonNull<ProtocolObject<dyn GCTouchedStateInput>>, Bool)>>, )
GCPhysicalInputElement
and block2
only.Setter for touchedDidChangeHandler
.
Sourceunsafe fn isTouched(&self) -> bool
unsafe fn isTouched(&self) -> bool
Some buttons feature capacitive touch capabilities, where the user can touch the button without pressing it. In such cases, a button will be touched before it is pressed.
See: touchedDidChangeHandler
See: GCPressedStateInput
Sourceunsafe fn lastTouchedStateTimestamp(&self) -> NSTimeInterval
unsafe fn lastTouchedStateTimestamp(&self) -> NSTimeInterval
The timestamp of the last touched state change.
This time interval is not relative to any specific point in time. You can subtract a previous timestamp from the returned timestamp to determine the time (in seconds) between changes to the value.
Sourceunsafe fn lastTouchedStateLatency(&self) -> NSTimeInterval
unsafe fn lastTouchedStateLatency(&self) -> NSTimeInterval
The interval (in seconds) between the timestamp of the last touched state 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.