Skip to main content

gdk/
event_pad_button.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::translate::*;
4
5/// Generated during [`InputSource::TabletPad`][crate::InputSource::TabletPad] button presses and releases.
6#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
7pub struct EventPadButton(crate::Event);
8
9event_wrapper!(EventPadButton, GdkEventPadButton);
10event_subtype!(
11    EventPadButton,
12    ffi::GDK_PAD_BUTTON_PRESS | ffi::GDK_PAD_BUTTON_RELEASE
13);
14
15impl EventPadButton {
16    #[doc(alias = "get_time")]
17    pub fn time(&self) -> u32 {
18        self.as_ref().time
19    }
20
21    #[doc(alias = "get_group")]
22    pub fn group(&self) -> u32 {
23        self.as_ref().group
24    }
25
26    #[doc(alias = "get_button")]
27    pub fn button(&self) -> u32 {
28        self.as_ref().button
29    }
30
31    #[doc(alias = "get_mode")]
32    pub fn mode(&self) -> u32 {
33        self.as_ref().mode
34    }
35}