#[non_exhaustive]pub enum ButtonSource {
Mouse(MouseButton),
Touch {
finger_id: FingerId,
force: Option<Force>,
},
TabletTool {
kind: TabletToolKind,
button: TabletToolButton,
data: TabletToolData,
},
Unknown(u16),
}Expand description
Represents the pointer type of a WindowEvent::PointerButton.
Wayland/X11: Unknown device types are converted to known variants by the
system.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Mouse(MouseButton)
§Platform-specific
§macOS
Users may expect holding CTRL while
clicking MouseButton::Left to result in a “secondary” click, but the way these
clicks behave natively is slightly different from how a physical secondary
button press would, depending on the content under the cursor when clicked. If
applications want this behavior they should implement it themselves by interpreting
Left clicks as secondary when
CTRL is held and their internal logic deems it
appropriate for the content under the pointer.
See also https://github.com/rust-windowing/winit/issues/4469.
Touch
TabletTool
Unknown(u16)
A pointer button of unknown source.
Codes are undefined and may not be reproducible across platforms or winit versions.
Implementations§
Source§impl ButtonSource
impl ButtonSource
Try to convert a ButtonSource to an equivalent MouseButton. If a pointer type has no
special handling in an application, this method can be used to handle it like any generic
mouse input.
Trait Implementations§
Source§impl Clone for ButtonSource
impl Clone for ButtonSource
Source§fn clone(&self) -> ButtonSource
fn clone(&self) -> ButtonSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more