PixelBullet
0.0.1
A C++ game engine
Loading...
Searching...
No Matches
engine
include
pixelbullet
input
text_events.h
1
#pragma once
2
3
#include "pixelbullet/core/event.h"
4
5
#include <cstdint>
6
#include <sstream>
7
#include <string>
8
9
namespace
pixelbullet::input
10
{
11
class
TextInputEvent :
public
core::Event
12
{
13
public
:
14
explicit
TextInputEvent(
char32_t
codepoint)
15
: codepoint_(codepoint)
16
{
17
}
18
19
[[nodiscard]]
char32_t
codepoint()
const
noexcept
20
{
21
return
codepoint_;
22
}
23
24
[[nodiscard]] std::string to_string()
const override
25
{
26
std::stringstream ss;
27
ss <<
"TextInputEvent: "
<<
static_cast<
std::uint32_t
>
(codepoint_);
28
return
ss.str();
29
}
30
31
PB_EVENT_TYPE(TextInput)
32
PB_EVENT_CATEGORIES(core::EventCategory::Input | core::EventCategory::Keyboard)
33
34
private
:
35
char32_t
codepoint_ = U
'\0'
;
36
};
37
}
// namespace pixelbullet::input
pixelbullet::core::Event
Definition
event.h:108
Generated by
1.16.1