Struct gdk::Event [−]
pub struct Event(_);
A generic GDK event.
Methods
impl Event[src]
impl Eventpub fn new(type_: EventType) -> Event[src]
pub fn new(type_: EventType) -> EventCreates a new event.
pub fn get() -> Option<Event>[src]
pub fn get() -> Option<Event>pub fn put(&self)[src]
pub fn put(&self)pub fn set_handler<F: Fn(&mut Event) + 'static>(handler: Option<F>)[src]
pub fn set_handler<F: Fn(&mut Event) + 'static>(handler: Option<F>)Set the event handler.
The callback handler is called for each event. If None, event
handling is disabled.
pub fn get_axis(&self, axis_use: AxisUse) -> Option<f64>[src]
pub fn get_axis(&self, axis_use: AxisUse) -> Option<f64>pub fn get_click_count(&self) -> Option<u32>[src]
pub fn get_click_count(&self) -> Option<u32>pub fn get_coords(&self) -> Option<(f64, f64)>[src]
pub fn get_coords(&self) -> Option<(f64, f64)>pub fn get_keycode(&self) -> Option<u16>[src]
pub fn get_keycode(&self) -> Option<u16>pub fn get_keyval(&self) -> Option<u32>[src]
pub fn get_keyval(&self) -> Option<u32>pub fn get_root_coords(&self) -> Option<(f64, f64)>[src]
pub fn get_root_coords(&self) -> Option<(f64, f64)>pub fn get_scroll_direction(&self) -> Option<ScrollDirection>[src]
pub fn get_scroll_direction(&self) -> Option<ScrollDirection>pub fn get_scroll_deltas(&self) -> Option<(f64, f64)>[src]
pub fn get_scroll_deltas(&self) -> Option<(f64, f64)>pub fn get_state(&self) -> Option<ModifierType>[src]
pub fn get_state(&self) -> Option<ModifierType>pub fn get_time(&self) -> u32[src]
pub fn get_time(&self) -> u32pub fn get_window(&self) -> Option<Window>[src]
pub fn get_window(&self) -> Option<Window>Returns the associated Window if applicable.
pub fn get_event_sequence(&self) -> Option<EventSequence>[src]
pub fn get_event_sequence(&self) -> Option<EventSequence>pub fn set_screen<'a, T: Into<Option<&'a Screen>>>(&mut self, screen: T)[src]
pub fn set_screen<'a, T: Into<Option<&'a Screen>>>(&mut self, screen: T)pub fn get_screen(&self) -> Option<Screen>[src]
pub fn get_screen(&self) -> Option<Screen>pub fn set_device<'a, T: Into<Option<&'a Device>>>(&mut self, device: T)[src]
pub fn set_device<'a, T: Into<Option<&'a Device>>>(&mut self, device: T)pub fn get_device(&self) -> Option<Device>[src]
pub fn get_device(&self) -> Option<Device>pub fn set_source_device<'a, T: Into<Option<&'a Device>>>(&mut self, device: T)[src]
pub fn set_source_device<'a, T: Into<Option<&'a Device>>>(&mut self, device: T)pub fn get_source_device(&self) -> Option<Device>[src]
pub fn get_source_device(&self) -> Option<Device>pub fn get_event_type(&self) -> EventType[src]
pub fn get_event_type(&self) -> EventTypeReturns the event type.
pub fn get_send_event(&self) -> bool[src]
pub fn get_send_event(&self) -> boolReturns whether the event was sent explicitly.
pub fn is<T: FromEvent>(&self) -> bool[src]
pub fn is<T: FromEvent>(&self) -> boolReturns true if the event type matches T.
pub fn downcast<T: FromEvent>(self) -> Result<T, Self>[src]
pub fn downcast<T: FromEvent>(self) -> Result<T, Self>Tries to downcast to a specific event type.
Trait Implementations
impl PartialEq for Event[src]
impl PartialEq for Eventfn eq(&self, other: &Event) -> bool[src]
fn eq(&self, other: &Event) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Event) -> bool[src]
fn ne(&self, other: &Event) -> boolThis method tests for !=.
impl Eq for Event[src]
impl Eq for Eventimpl PartialOrd for Event[src]
impl PartialOrd for Eventfn partial_cmp(&self, other: &Event) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &Event) -> Option<Ordering>This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, other: &Event) -> bool[src]
fn lt(&self, other: &Event) -> boolThis method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, other: &Event) -> bool[src]
fn le(&self, other: &Event) -> boolThis method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, other: &Event) -> bool[src]
fn gt(&self, other: &Event) -> boolThis method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, other: &Event) -> bool[src]
fn ge(&self, other: &Event) -> boolThis method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl Ord for Event[src]
impl Ord for Eventfn cmp(&self, other: &Event) -> Ordering[src]
fn cmp(&self, other: &Event) -> OrderingThis method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.21.0[src]
fn max(self, other: Self) -> SelfCompares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
fn min(self, other: Self) -> SelfCompares and returns the minimum of two values. Read more
impl Hash for Event[src]
impl Hash for Eventfn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash<__H: Hasher>(&self, state: &mut __H)Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl Clone for Event
impl Clone for Eventfn clone(&self) -> Event
fn clone(&self) -> EventReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl StaticType for Event
impl StaticType for Eventfn static_type() -> Type
fn static_type() -> TypeReturns the type identifier of Self.
impl Debug for Event[src]
impl Debug for Eventfn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>[src]
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>Formats the value using the given formatter. Read more
impl<'a> ToGlibPtr<'a, *const GdkEventAny> for Event[src]
impl<'a> ToGlibPtr<'a, *const GdkEventAny> for Eventtype Storage = &'a Self
fn to_glib_none(&'a self) -> Stash<'a, *const GdkEventAny, Self>[src]
fn to_glib_none(&'a self) -> Stash<'a, *const GdkEventAny, Self>Transfer: none. Read more
fn to_glib_container(&'a self) -> Stash<'a, P, Self>[src]
fn to_glib_container(&'a self) -> Stash<'a, P, Self>Transfer: container. Read more
fn to_glib_full(&self) -> P[src]
fn to_glib_full(&self) -> PTransfer: full. Read more
impl<'a> ToGlibPtrMut<'a, *mut GdkEventAny> for Event[src]
impl<'a> ToGlibPtrMut<'a, *mut GdkEventAny> for Eventtype Storage = &'a mut Self
fn to_glib_none_mut(&'a mut self) -> StashMut<'a, *mut GdkEventAny, Self>[src]
fn to_glib_none_mut(&'a mut self) -> StashMut<'a, *mut GdkEventAny, Self>Transfer: none. Read more
impl FromGlibPtrNone<*mut GdkEventAny> for Event[src]
impl FromGlibPtrNone<*mut GdkEventAny> for Eventunsafe fn from_glib_none(ptr: *mut GdkEventAny) -> Self[src]
unsafe fn from_glib_none(ptr: *mut GdkEventAny) -> Selfimpl FromGlibPtrBorrow<*mut GdkEventAny> for Event[src]
impl FromGlibPtrBorrow<*mut GdkEventAny> for Eventunsafe fn from_glib_borrow(ptr: *mut GdkEventAny) -> Self[src]
unsafe fn from_glib_borrow(ptr: *mut GdkEventAny) -> Selfimpl FromGlibPtrFull<*mut GdkEventAny> for Event[src]
impl FromGlibPtrFull<*mut GdkEventAny> for Eventunsafe fn from_glib_full(ptr: *mut GdkEventAny) -> Self[src]
unsafe fn from_glib_full(ptr: *mut GdkEventAny) -> Selfimpl AsRef<GdkEventAny> for Event[src]
impl AsRef<GdkEventAny> for Eventfn as_ref(&self) -> &GdkEventAny[src]
fn as_ref(&self) -> &GdkEventAnyPerforms the conversion.
impl AsMut<GdkEventAny> for Event[src]
impl AsMut<GdkEventAny> for Eventfn as_mut(&mut self) -> &mut GdkEventAny[src]
fn as_mut(&mut self) -> &mut GdkEventAnyPerforms the conversion.