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