Char_InputNode.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "InputNode.hpp"
4 #include "../TimeSystem/Watch.hpp"
5 
7 
8 namespace iv
9 {
10 
11 class Char_InputNode;
12 
14 {
15 public:
17 
18  CharListener( Instance * inst );
19  ~CharListener();
20  Instance * instance() const;
21 
22  virtual void on_char( Char_InputNode * event, unsigned codepoint ){};
23 
24 private:
25  Instance * inst;
26 };
27 
28 
29 class Char_InputNode : public InputNode
30 {
31 public:
34 
35  static const constexpr int RepeatFirstMs = 800;
36  static const constexpr int RepeatOtherMs = 40;
37 
38  Char_InputNode( Instance * inst, TimeId time_type );
39 
42 
43 protected:
44  // InputNode
45  virtual bool input_trigger_process( InputRoot * root, Input::DeviceKey key ) override;
46 
47 private:
48  friend class CharListener;
49 
50  void add_char_listener( CharListener * listener );
51  void remove_char_listener( CharListener * listener );
52 
53 private:
54  volatile_set< CharListener * > char_listeners;
55 };
56 
57 
58 }