OpenCOVER
vruiButtons.h
Go to the documentation of this file.
1/* This file is part of COVISE.
2
3 You can use it under the terms of the GNU Lesser General Public License
4 version 2.1 or later, see lgpl-2.1.txt.
5
6 * License: LGPL 2+ */
7
8#ifndef VRUI_BUTTONS_H
9#define VRUI_BUTTONS_H
10
11#include <util/coTypes.h>
12#include "../coInteraction.h"
13
14namespace vrui
15{
16
17class OPENVRUIEXPORT vruiButtons
18{
19public:
21 {
22 }
23 virtual ~vruiButtons();
24
25 enum Button
26 {
27 NO_BUTTON = 0x0000,
28 ACTION_BUTTON = 1<<coInteraction::ButtonAction,
29 DRIVE_BUTTON = 1<<coInteraction::ButtonDrive,
30 XFORM_BUTTON = 1<<coInteraction::ButtonXform,
31 FORWARD_BUTTON = 1<<coInteraction::ButtonForward,
32 BACKWARD_BUTTON = 1<<coInteraction::ButtonBack,
33 TOGGLE_DOCUMENTS = 1<coInteraction::ButtonToggleDocuments,
34 DRAG_BUTTON = 1<<coInteraction::ButtonDrag,
35 ZOOM_BUTTON = 1<<coInteraction::ButtonZoom,
36 MENU_BUTTON = 1<<coInteraction::ButtonMenu,
37 QUIT_BUTTON = 1<<coInteraction::ButtonQuit,
38 INTER_NEXT = 1<<coInteraction::ButtonNextInter,
39 INTER_PREV = 1<<coInteraction::ButtonPrevInter,
40 PERSON_NEXT = 1<<coInteraction::ButtonNextPerson,
41 PERSON_PREV = 1<<coInteraction::ButtonPrevPerson,
42 WHEEL_UP = 0x01000000,
43 WHEEL_DOWN = 0x02000000,
44 WHEEL_LEFT = 0x04000000,
45 WHEEL_RIGHT = 0x08000000,
46 WHEEL = WHEEL_UP | WHEEL_DOWN | WHEEL_LEFT | WHEEL_RIGHT,
47 JOYSTICK_RIGHT = 0x10000000,
48 JOYSTICK_DOWN = 0x20000000,
49 JOYSTICK_LEFT = 0x40000000,
50 JOYSTICK_UP = 0x80000000,
51 ALL_BUTTONS = ACTION_BUTTON | DRIVE_BUTTON | XFORM_BUTTON | FORWARD_BUTTON | BACKWARD_BUTTON
52 };
53 static_assert(coInteraction::ButtonPrevPerson == coInteraction::LastButton, "add missing buttons in Buttons enum");
54
55 virtual unsigned int wasPressed(unsigned int buttonMask=ALL_BUTTONS) const = 0;
56 virtual unsigned int wasReleased(unsigned int buttonMask=ALL_BUTTONS) const = 0;
57
58 virtual unsigned int getStatus() const = 0;
59 virtual unsigned int getOldStatus() const = 0;
60
61 virtual int getWheelCount(size_t idx=0) const = 0;
62};
63}
64#endif
collaborative interface manager
Definition: coVRCommunication.h:41
@ ButtonToggleDocuments
Definition: coInteraction.h:56
@ ButtonZoom
Definition: coInteraction.h:58
@ ButtonPrevPerson
Definition: coInteraction.h:64
@ ButtonAction
Definition: coInteraction.h:47
@ ButtonNextPerson
Definition: coInteraction.h:63
@ LastButton
Definition: coInteraction.h:65
@ ButtonDrive
Definition: coInteraction.h:49
@ ButtonBack
Definition: coInteraction.h:55
@ ButtonXform
Definition: coInteraction.h:51
@ ButtonQuit
Definition: coInteraction.h:60
@ ButtonMenu
Definition: coInteraction.h:59
@ ButtonForward
Definition: coInteraction.h:53
@ ButtonPrevInter
Definition: coInteraction.h:62
@ ButtonNextInter
Definition: coInteraction.h:61
@ ButtonDrag
Definition: coInteraction.h:57
Definition: vruiButtons.h:18
virtual unsigned int wasPressed(unsigned int buttonMask=ALL_BUTTONS) const =0
virtual unsigned int getOldStatus() const =0
virtual unsigned int getStatus() const =0
vruiButtons()
Definition: vruiButtons.h:20
virtual ~vruiButtons()
virtual unsigned int wasReleased(unsigned int buttonMask=ALL_BUTTONS) const =0
virtual int getWheelCount(size_t idx=0) const =0
Button
Definition: vruiButtons.h:26