pub unsafe trait GCButtonElement: GCPhysicalInputElement {
// Provided methods
unsafe fn pressedInput(&self) -> Retained<AnyObject>
where Self: Sized + Message { ... }
unsafe fn touchedInput(
&self,
) -> Option<Retained<ProtocolObject<dyn GCTouchedStateInput>>>
where Self: Sized + Message { ... }
unsafe fn forceInput(
&self,
) -> Option<Retained<ProtocolObject<dyn GCLinearInput>>>
where Self: Sized + Message { ... }
}Available on crate features
GCButtonElement and GCPhysicalInputElement only.Expand description
An object conforming to
GCButtonElementrepresents a momentary switch,
such as a push button. A button’s input only asserts while the user is
interacting with it, and then returns to a preferred state (not pressed, not
touched).
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn pressedInput(&self) -> Retained<AnyObject>
Available on crate features GCLinearInput and GCPressedStateInput only.
unsafe fn pressedInput(&self) -> Retained<AnyObject>
GCLinearInput and GCPressedStateInput only.Get the input containing the pressed state of the button.
Sourceunsafe fn touchedInput(
&self,
) -> Option<Retained<ProtocolObject<dyn GCTouchedStateInput>>>
Available on crate feature GCTouchedStateInput only.
unsafe fn touchedInput( &self, ) -> Option<Retained<ProtocolObject<dyn GCTouchedStateInput>>>
GCTouchedStateInput only.Get the input containing the touched state of the button.
Some buttons feature capacitive touch capabilities where the user can touch the button without pressing it.
Sourceunsafe fn forceInput(
&self,
) -> Option<Retained<ProtocolObject<dyn GCLinearInput>>>
Available on crate feature GCLinearInput only.
unsafe fn forceInput( &self, ) -> Option<Retained<ProtocolObject<dyn GCLinearInput>>>
GCLinearInput only.Get the input containing the measured force applied to the button.
Some buttons feature load cells (also known as button force transducers) capable of measuring applied mechanical force.