Struct gdk::EventButton [−][src]
pub struct EventButton(_);
Expand description
Used for button press and button release events. The
type field will be one of EventType::ButtonPress,
[EventType::_2buttonPress][crate::EventType::_2buttonPress], [EventType::_3buttonPress][crate::EventType::_3buttonPress] or EventType::ButtonRelease,
Double and triple-clicks result in a sequence of events being received. For double-clicks the order of events will be:
EventType::ButtonPressEventType::ButtonReleaseEventType::ButtonPress- [
EventType::_2buttonPress][crate::EventType::_2buttonPress] EventType::ButtonRelease
Note that the first click is received just like a normal
button press, while the second click results in a [EventType::_2buttonPress][crate::EventType::_2buttonPress]
being received just after the EventType::ButtonPress.
Triple-clicks are very similar to double-clicks, except that
[EventType::_3buttonPress][crate::EventType::_3buttonPress] is inserted after the third click. The order of the
events is:
EventType::ButtonPressEventType::ButtonReleaseEventType::ButtonPress- [
EventType::_2buttonPress][crate::EventType::_2buttonPress] EventType::ButtonReleaseEventType::ButtonPress- [
EventType::_3buttonPress][crate::EventType::_3buttonPress] EventType::ButtonRelease
For a double click to occur, the second button press must occur within 1/4 of a second of the first. For a triple click to occur, the third button press must also occur within 1/2 second of the first button press.
Implementations
Methods from Deref<Target = Event>
v3_20 only.v3_20 only.v3_22 only.v3_22 only.v3_22 only.v3_22 only.Returns the event type.
Returns whether the event was sent explicitly.
Tries to downcast to a specific event type.
Tries to downcast to a specific event type.
Trait Implementations
Performs the conversion.
Performs the conversion.
Safety Read more
Safety Read more
Safety Read more
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Transfer: none. Read more
Auto Trait Implementations
impl RefUnwindSafe for EventButtonimpl !Send for EventButtonimpl !Sync for EventButtonimpl Unpin for EventButtonimpl UnwindSafe for EventButtonBlanket Implementations
Mutably borrows from an owned value. Read more