gdk/
event_pad_button.rs

1// Copyright 2018, The Gtk-rs Project Developers.
2// See the COPYRIGHT file at the top-level directory of this distribution.
3// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
4
5use gdk_sys;
6use glib::translate::*;
7
8#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
9pub struct EventPadButton(::Event);
10
11event_wrapper!(EventPadButton, GdkEventPadButton);
12event_subtype!(
13    EventPadButton,
14    gdk_sys::GDK_PAD_BUTTON_PRESS | gdk_sys::GDK_PAD_BUTTON_RELEASE
15);
16
17impl EventPadButton {
18    pub fn get_time(&self) -> u32 {
19        self.as_ref().time
20    }
21
22    pub fn get_group(&self) -> u32 {
23        self.as_ref().group
24    }
25
26    pub fn get_button(&self) -> u32 {
27        self.as_ref().button
28    }
29
30    pub fn get_mode(&self) -> u32 {
31        self.as_ref().mode
32    }
33}