OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
22 namespace opencover
23 {
24 
25 class InputDevice;
26 
27 class COVEREXPORT ButtonDevice: public InputSource
28 {
29  friend class Input;
30  friend class coMousePointer;
31 
32 public:
33  unsigned getButtonState() const;
34 
35 private:
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: buttondevice.h:27
Definition: inputsource.h:26
The Input class.
Definition: input.h:38
Definition: coMousePointer.h:46