Toggle navigation
ivorium
iv_components
Example project
GitHub
Main Page
Modules
Classes
Files
File List
File Members
ivorium_systems
InputSystem
Char_InputNode.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
InputNode.hpp
"
4
#include "../TimeSystem/Watch.hpp"
5
6
#include <
ivorium_core/ivorium_core.hpp
>
7
8
namespace
iv
9
{
10
11
class
Char_InputNode;
12
13
class
CharListener
14
{
15
public
:
16
ClientMarker
cm
;
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
:
32
ClientMarker
cm
;
33
using
InputNode::instance
;
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
40
void
Insert_CharListener
(
CharListener
* );
41
void
Remove_CharListener
(
CharListener
* );
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
}