CoriEngine
Loading...
Searching...
No Matches
CoriMouseCodes.hpp
Go to the documentation of this file.
1
#pragma once
2
#include <string_view>
3
#define MAGIC_ENUM_RANGE_MIN 0
4
#define MAGIC_ENUM_RANGE_MAX 512
5
#include <magic_enum/magic_enum.hpp>
6
7
namespace
Cori
{
8
namespace
Core {
12
typedef
enum
CoriMouseCode
{
13
CORI_MOUSEBUTTON_UNKNOWN
= 0,
14
CORI_MOUSEBUTTON_LEFT
= 1,
15
CORI_MOUSEBUTTON_MIDDLE
= 2,
16
CORI_MOUSEBUTTON_RIGHT
= 3,
17
CORI_MOUSEBUTTON_X1
= 4,
18
CORI_MOUSEBUTTON_X2
= 5
19
}
CoriMouseKeycode
;
20
21
[[maybe_unused]]
static
std::string
CoriGetKeyName
(
const
CoriMouseKeycode
code) {
22
std::string_view name = magic_enum::enum_name(code);
23
constexpr
std::string_view prefix =
"CORI_"
;
24
if
(name.starts_with(prefix)) {
25
name.remove_prefix(prefix.size());
26
}
27
return
std::string(name);
28
}
29
}
30
}
Cori::Core::CoriGetKeyName
static std::string CoriGetKeyName(const CoriKeycode code)
Definition
CoriKeycodes.hpp:391
Cori::Core::CoriMouseCode
CoriMouseCode
An enum of all available mouse buttons.
Definition
CoriMouseCodes.hpp:12
Cori::Core::CORI_MOUSEBUTTON_UNKNOWN
@ CORI_MOUSEBUTTON_UNKNOWN
Definition
CoriMouseCodes.hpp:13
Cori::Core::CORI_MOUSEBUTTON_X2
@ CORI_MOUSEBUTTON_X2
Definition
CoriMouseCodes.hpp:18
Cori::Core::CORI_MOUSEBUTTON_X1
@ CORI_MOUSEBUTTON_X1
Definition
CoriMouseCodes.hpp:17
Cori::Core::CORI_MOUSEBUTTON_MIDDLE
@ CORI_MOUSEBUTTON_MIDDLE
Definition
CoriMouseCodes.hpp:15
Cori::Core::CORI_MOUSEBUTTON_LEFT
@ CORI_MOUSEBUTTON_LEFT
Definition
CoriMouseCodes.hpp:14
Cori::Core::CORI_MOUSEBUTTON_RIGHT
@ CORI_MOUSEBUTTON_RIGHT
Definition
CoriMouseCodes.hpp:16
Cori::Core::CoriMouseKeycode
enum Cori::Core::CoriMouseCode CoriMouseKeycode
An enum of all available mouse buttons.
Cori
Global engine namespace.
Definition
AssetLoadStatus.hpp:3
CoriEngine
Engine
src
Core
CoriMouseCodes.hpp
Generated by
1.14.0