17 #ifndef _KEY_EVENT_HANDLER_HH_
18 #define _KEY_EVENT_HANDLER_HH_
20 #include <boost/function.hpp>
38 public:
typedef boost::function<bool (const common::KeyEvent &_event)>
48 public: Filter(
const std::string &_name,
50 : name(_name), func(_func) {}
55 public:
bool operator==(
const Filter &_f)
const
57 return this->name == _f.name;
63 public:
bool operator==(
const std::string &_f)
const
65 return this->name == _f;
69 public: std::string name;
72 public: KeyEventFilter func;
76 private: KeyEventHandler();
79 private:
virtual ~KeyEventHandler();
84 public:
void AddPressFilter(
const std::string &_name,
85 KeyEventFilter _filter);
90 public:
void AddReleaseFilter(
const std::string &_name,
91 KeyEventFilter _filter);
95 public:
void RemovePressFilter(
const std::string &_name);
99 public:
void RemoveReleaseFilter(
const std::string &_name);
103 public:
void HandlePress(
const common::KeyEvent &_event);
107 public:
void HandleRelease(
const common::KeyEvent &_event);
113 private:
void Add(
const std::string &_name, KeyEventFilter _filter,
114 std::list<Filter> &_list);
119 private:
void Remove(
const std::string &_name, std::list<Filter> &_list);
124 private:
void Handle(
const common::KeyEvent &_event,
125 std::list<Filter> &_list);
128 private: std::list<Filter> pressFilters;
131 private: std::list<Filter> releaseFilters;
134 private:
friend class SingletonT<KeyEventHandler>;
Singleton template class.
Definition: SingletonT.hh:33
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48