Skip to content

Commit

Permalink
Moved back various definitions from KeyDef.hpp to Handler.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
UE4SS committed Jan 11, 2025
1 parent 0d83373 commit 0524dc8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
24 changes: 24 additions & 0 deletions deps/first/Input/include/Input/Handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,31 @@

namespace RC::Input
{
using EventCallbackCallable = std::function<void()>;

struct InputEvent
{
Key key;
ModifierKeys modifier_keys{};
};

struct KeyData
{
ModifierKeys required_modifier_keys{};
EventCallbackCallable callback{};
uint8_t custom_data{};
void* custom_data2{};
bool requires_modifier_keys{};
bool is_down{};
};

struct KeySet
{
std::unordered_map<Key, std::vector<KeyData>> key_data;
};

using ModifierKeyArray = std::array<Input::ModifierKey, max_modifier_keys>;

#ifdef HAS_INPUT
class PlatformInputSource;
class RC_INPUT_API Handler
Expand Down
24 changes: 0 additions & 24 deletions deps/first/Input/include/Input/KeyDef.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <stdexcept>
#include <cstdint>
#include <initializer_list>
#include <functional>

namespace RC::Input
{
Expand Down Expand Up @@ -304,27 +303,4 @@ namespace RC::Input
auto operator&(const ModifierKeys& keys, const ModifierKeys& key) -> bool;

auto operator++(Input::Key& key) -> Input::Key&;

using EventCallbackCallable = std::function<void()>;

struct InputEvent
{
Key key;
ModifierKeys modifier_keys{};
};

struct KeyData
{
ModifierKeys required_modifier_keys{};
EventCallbackCallable callback{};
uint8_t custom_data{};
void* custom_data2{};
bool requires_modifier_keys{};
bool is_down{};
};

struct KeySet
{
std::unordered_map<Key, std::vector<KeyData>> key_data;
};
} // namespace RC::Input

0 comments on commit 0524dc8

Please sign in to comment.