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 */
25class 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();
37
39
40public:
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
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A ButtonHandle represents a single button from any device, including keyboard buttons and mouse butto...
This class is just used as a convenient namespace for grouping all of these handy functions that retu...
Definition mouseButton.h:25
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...
static ButtonHandle button(int button_number)
Returns the ButtonHandle associated with the particular numbered mouse button (zero-based),...
static ButtonHandle four()
Returns the ButtonHandle associated with the fourth mouse button.
static ButtonHandle wheel_left()
Returns the ButtonHandle generated when the mouse is scrolled to the left.
static ButtonHandle wheel_up()
Returns the ButtonHandle generated when the mouse wheel is rolled one notch upwards.
static ButtonHandle one()
Returns the ButtonHandle associated with the first mouse button.
static ButtonHandle five()
Returns the ButtonHandle associated with the fifth mouse button.
static ButtonHandle two()
Returns the ButtonHandle associated with the second mouse button.
static ButtonHandle wheel_right()
Returns the ButtonHandle generated when the mouse is scrolled to the right.
static void init_mouse_buttons()
This is intended to be called only once, by the static initialization performed in config_putil....
static ButtonHandle wheel_down()
Returns the ButtonHandle generated when the mouse wheel is rolled one notch downwards.
static ButtonHandle three()
Returns the ButtonHandle associated with the third mouse button.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.