Input.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <etk/types.hpp>
9 
10 namespace ewol {
11  namespace event {
12  class Input {
13  private:
14  enum gale::key::type m_type;
15  enum gale::key::status m_status;
16  uint8_t m_inputId;
17  vec2 m_pos;
18  gale::key::Special m_specialKey;
19  public:
20  Input(enum gale::key::type _type,
21  enum gale::key::status _status,
22  uint8_t _id,
23  const vec2& _pos,
24  gale::key::Special _specialKey):
25  m_type(_type),
26  m_status(_status),
27  m_inputId(_id),
28  m_pos(_pos),
29  m_specialKey(_specialKey) {
30 
31  };
32  void setType(enum gale::key::type _type) {
33  m_type = _type;
34  };
35  inline const enum gale::key::type& getType() const {
36  return m_type;
37  };
38  void setStatus(enum gale::key::status _status) {
39  m_status = _status;
40  };
41  inline const enum gale::key::status& getStatus() const {
42  return m_status;
43  };
44  void setId(uint8_t _id) {
45  m_inputId = _id;
46  };
47  inline const uint8_t& getId() const {
48  return m_inputId;
49  };
50  void setPos(const vec2& _pos) {
51  m_pos = _pos;
52  };
53  inline const vec2& getPos() const {
54  return m_pos;
55  };
56  void setSpecialKey(const gale::key::Special& _specialKey) {
57  m_specialKey = _specialKey;
58  };
59  inline const gale::key::Special& getSpecialKey() const {
60  return m_specialKey;
61  };
65  void reset() const {
66  // TODO : Call the entry element ant rest it ...
67  }
68  };
69  std::ostream& operator <<(std::ostream& _os, const ewol::event::Input& _obj);
70 
71  class InputSystem {
72  public:
73  InputSystem(enum gale::key::type _type,
74  enum gale::key::status _status,
75  uint8_t _id,
76  const vec2& _pos,
77  ewol::WidgetShared _dest,
78  int32_t _realIdEvent,
79  gale::key::Special _specialKey) :
80  m_event(_type, _status, _id, _pos, _specialKey),
81  m_dest(_dest),
82  m_realIdEvent(_realIdEvent) { };
83  ewol::event::Input m_event;
84  private:
85  ewol::WidgetShared m_dest;
86  int32_t m_realIdEvent;
87  public:
88  void setDestWidget(ewol::WidgetShared _dest) {
89  m_dest = _dest;
90  };
91  inline ewol::WidgetShared getDestWidget() const {
92  return m_dest;
93  };
94  void setRealId(int32_t _realIdEvent) {
95  m_realIdEvent = _realIdEvent;
96  };
97  inline int32_t getRealId() const {
98  return m_realIdEvent;
99  };
100  };
101  std::ostream& operator <<(std::ostream& _os, const ewol::event::InputSystem& _obj);
102  };
103 };
104 
Definition: Input.hpp:12
Definition: Area.hpp:16
Definition: Input.hpp:71
void reset() const
Reset the input property of the curent event.
Definition: Input.hpp:65