OpenCOVER
buttondevice.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/*
9 * buttondevice.h
10 *
11 * Created on: Dec 5, 2014
12 * Author: svnvlad
13 */
14
15#ifndef BUTTONDEVICE_H
16#define BUTTONDEVICE_H
17
18#include <iostream>
19#include <map>
20#include "inputsource.h"
21
22namespace opencover
23{
24
25class InputDevice;
26
27class COVEREXPORT ButtonDevice: public InputSource
28{
29 friend class Input;
30 friend class coMousePointer;
31
32public:
33 unsigned getButtonState() const;
34
35private:
36 ButtonDevice(const std::string &name);
37
38 void update();
39 void setButtonState(unsigned int state, bool isRaw = false);
40
41 typedef std::map<unsigned, unsigned> ButtonMap;
42 ButtonMap buttonMap, multiButtonMap;
43 void createButtonMap(const std::string &confbase);
44 unsigned mapButton(unsigned raw) const;
45
46 unsigned int m_raw, m_oldRaw;
47 unsigned int m_btnstatus;
48};
49}
50#endif /* BUTTONDEVICE_H_ */
Definition: ARToolKit.h:33
Definition: buttondevice.h:28
unsigned getButtonState() const
Definition: coMousePointer.h:48
The Input class.
Definition: input.h:40
Definition: inputsource.h:28