EEROS  1.0.0.0
API for the EEROS Real-Time Robotics Framework
KeyboardDigIn.hpp
Go to the documentation of this file.
1 #ifndef ORG_EEROS_KEYBOARD_DIGIN_HPP_
2 #define ORG_EEROS_KEYBOARD_DIGIN_HPP_
3 
4 #include <eeros/hal/Input.hpp>
5 #include <eeros/hal/Mouse.hpp>
6 #include <fstream>
7 #include <string>
8 
9 namespace eeros {
10  namespace hal {
11  class KeyboardDigIn : public Input<bool> {
12  public:
13  KeyboardDigIn(std::string id, Keyboard* k) : Input<bool>(id, nullptr), k(k) { }
15  virtual bool get() {
16  if (getId().compare("escKeyboardButton") == 0) return k->events.esc;
17  if (getId().compare("emergencyKeyboardButton") == 0) return k->events.emergency;
18  if (getId().compare("resetKeyboardButton") == 0) return k->events.reset;
19  if (getId().compare("startKeyboardButton") == 0) return k->events.start;
20  if (getId().compare("stopKeyboardButton") == 0) return k->events.stop;
21  return false;
22  }
23 
24  private:
25  Keyboard* k;
26  };
27 
28  };
29 };
30 
31 #endif /* ORG_EEROS_KEYBOARD_DIGIN_HPP_ */
Definition: KeyboardDigIn.hpp:11
bool esc
Definition: Keyboard.hpp:15
~KeyboardDigIn()
Definition: KeyboardDigIn.hpp:14
bool reset
Definition: Keyboard.hpp:17
bool stop
Definition: Keyboard.hpp:19
Definition: Input.hpp:17
Definition: Config.hpp:14
bool emergency
Definition: Keyboard.hpp:16
Events events
Definition: Keyboard.hpp:26
KeyboardDigIn(std::string id, Keyboard *k)
Definition: KeyboardDigIn.hpp:13
Definition: Keyboard.hpp:22
bool start
Definition: Keyboard.hpp:18
virtual std::string getId() const
Definition: Input.hpp:21