Panda3D

Loading...
Searching...
No Matches
mouseButton.h
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file mouseButton.h
10 * @author drose
11 * @date 2000-03-01
12 */
13
14#ifndef MOUSEBUTTON_H
15#define MOUSEBUTTON_H
16
17#include "pandabase.h"
18
19#include "buttonHandle.h"
20
21/**
22 * This class is just used as a convenient namespace for grouping all of these
23 * handy functions that return buttons which map to standard mouse buttons.
24 */
25 class EXPCL_PANDA_PUTIL MouseButton {
26PUBLISHED:
27 static ButtonHandle button(int button_number);
28 static ButtonHandle one();
29 static ButtonHandle two();
30 static ButtonHandle three();
31 static ButtonHandle four();
32 static ButtonHandle five();
33 static ButtonHandle wheel_up();
34 static ButtonHandle wheel_down();
35 static ButtonHandle wheel_left();
36 static ButtonHandle wheel_right();
37
38 static bool is_mouse_button(ButtonHandle button);
39
40 public:
41 static void init_mouse_buttons();
42
43 enum { num_mouse_buttons = 5 };
44 static ButtonHandle _buttons[num_mouse_buttons];
45 static ButtonHandle _wheel_up;
46 static ButtonHandle _wheel_down;
47 static ButtonHandle _wheel_left;
48 static ButtonHandle _wheel_right;
49};
50
51#endif
buttonHandle.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
ButtonHandle
A ButtonHandle represents a single button from any device, including keyboard buttons and mouse butto...
Definition buttonHandle.h:26
MouseButton
This class is just used as a convenient namespace for grouping all of these handy functions that retu...
Definition mouseButton.h:25
MouseButton::is_mouse_button
static bool is_mouse_button(ButtonHandle button)
Returns true if the indicated ButtonHandle is a mouse button, false if it is some other kind of butto...
Definition mouseButton.cxx:120
MouseButton::button
static ButtonHandle button(int button_number)
Returns the ButtonHandle associated with the particular numbered mouse button (zero-based),...
Definition mouseButton.cxx:32
MouseButton::four
static ButtonHandle four()
Returns the ButtonHandle associated with the fourth mouse button.
Definition mouseButton.cxx:67
MouseButton::wheel_left
static ButtonHandle wheel_left()
Returns the ButtonHandle generated when the mouse is scrolled to the left.
Definition mouseButton.cxx:102
MouseButton::wheel_up
static ButtonHandle wheel_up()
Returns the ButtonHandle generated when the mouse wheel is rolled one notch upwards.
Definition mouseButton.cxx:84
MouseButton::one
static ButtonHandle one()
Returns the ButtonHandle associated with the first mouse button.
Definition mouseButton.cxx:43
MouseButton::five
static ButtonHandle five()
Returns the ButtonHandle associated with the fifth mouse button.
Definition mouseButton.cxx:75
MouseButton::two
static ButtonHandle two()
Returns the ButtonHandle associated with the second mouse button.
Definition mouseButton.cxx:51
MouseButton::wheel_right
static ButtonHandle wheel_right()
Returns the ButtonHandle generated when the mouse is scrolled to the right.
Definition mouseButton.cxx:111
MouseButton::init_mouse_buttons
static void init_mouse_buttons()
This is intended to be called only once, by the static initialization performed in config_putil....
Definition mouseButton.cxx:135
MouseButton::wheel_down
static ButtonHandle wheel_down()
Returns the ButtonHandle generated when the mouse wheel is rolled one notch downwards.
Definition mouseButton.cxx:93
MouseButton::three
static ButtonHandle three()
Returns the ButtonHandle associated with the third mouse button.
Definition mouseButton.cxx:59
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.