pub struct MouseEventFlags {
pub double_click: bool,
pub triple_click: bool,
pub mouse_moved: bool,
}Expand description
Per-event flags for click-repeat detection and movement — a struct of named
bool flags carried in every MouseEvent.
Check flags.double_click in a MouseDown handler to react to a
double-click without manually tracking timing. Note that there is no wheel
flag here: wheel state is the MouseEvent::wheel field, because a wheel
event is an independent event class (Event::MouseWheel), not a flag on
another class.
§Turbo Vision heritage
The magiblot eventFlags: ushort bitmask (meMouseMoved = 0x01,
meDoubleClick = 0x02, meTripleClick = 0x04) becomes a struct-of-bools
extending the 1992 guide’s single Double: Boolean field.
The click count is computed by the event loop, as in magiblot’s
TEventQueue::getMouseEvent: a press with the same buttons on the same
cell as the previous press, at most 440 ms later (the 1992 guide’s
DoubleDelay of 8 ticks × 55 ms), is a double click; the next such press is
a triple click; the one after that is a single click again. Apps tune the
interval with Program::set_double_delay_ms.
Fields§
§double_click: boolThis press completed a double click (the second press with the same buttons on the same cell within the double-click interval, default 440 ms).
Check this flag in a Event::MouseDown handler to distinguish a
double-click from a single click. The event loop computes it for every
backend; a flag a backend sets itself is overwritten.
triple_click: boolThis press completed a triple click (the press after a double click, same buttons, same cell, within the double-click interval).
mouse_moved: boolThe mouse moved since the last event.
Trait Implementations§
Source§impl Clone for MouseEventFlags
impl Clone for MouseEventFlags
Source§fn clone(&self) -> MouseEventFlags
fn clone(&self) -> MouseEventFlags
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MouseEventFlags
Source§impl Debug for MouseEventFlags
impl Debug for MouseEventFlags
Source§impl Default for MouseEventFlags
impl Default for MouseEventFlags
Source§fn default() -> MouseEventFlags
fn default() -> MouseEventFlags
impl Eq for MouseEventFlags
Source§impl PartialEq for MouseEventFlags
impl PartialEq for MouseEventFlags
impl StructuralPartialEq for MouseEventFlags
Auto Trait Implementations§
impl Freeze for MouseEventFlags
impl RefUnwindSafe for MouseEventFlags
impl Send for MouseEventFlags
impl Sync for MouseEventFlags
impl Unpin for MouseEventFlags
impl UnsafeUnpin for MouseEventFlags
impl UnwindSafe for MouseEventFlags
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.