mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-04-19 19:40:00 +03:00
feat(console): register event handlers for console
This commit is contained in:
parent
cfd7aff536
commit
ecf0c43e70
58
src/console/Handlers.cpp
Normal file
58
src/console/Handlers.cpp
Normal file
@ -0,0 +1,58 @@
|
||||
#include "console/Handlers.hpp"
|
||||
#include "event/Event.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
namespace {
|
||||
|
||||
int32_t OnChar(const EVENT_DATA_CHAR* data, void* param) {
|
||||
// TODO
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t OnIdle(const EVENT_DATA_IDLE* data, void* param) {
|
||||
// TODO
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t OnKeyDown(const EVENT_DATA_KEY* data, void* param) {
|
||||
// TODO
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t OnKeyDownRepeat(const EVENT_DATA_KEY* data, void* param) {
|
||||
// TODO
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t OnKeyUp(const EVENT_DATA_KEY* data, void* param) {
|
||||
// TODO
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t OnMouseDown(const EVENT_DATA_MOUSE* data, void* param) {
|
||||
// TODO
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t OnMouseMove(const EVENT_DATA_MOUSE* data, void* param) {
|
||||
// TODO
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t OnMouseUp(const EVENT_DATA_MOUSE* data, void* param) {
|
||||
// TODO
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void RegisterHandlers() {
|
||||
EventRegisterEx(EVENT_ID_CHAR, reinterpret_cast<EVENTHANDLERFUNC>(OnChar), nullptr, 7.0f);
|
||||
EventRegisterEx(EVENT_ID_IDLE, reinterpret_cast<EVENTHANDLERFUNC>(OnIdle), nullptr, 7.0f);
|
||||
EventRegisterEx(EVENT_ID_KEYDOWN, reinterpret_cast<EVENTHANDLERFUNC>(OnKeyDown), nullptr, 7.0f);
|
||||
EventRegisterEx(EVENT_ID_KEYUP, reinterpret_cast<EVENTHANDLERFUNC>(OnKeyUp), nullptr, 7.0f);
|
||||
EventRegisterEx(EVENT_ID_KEYDOWN_REPEATING, reinterpret_cast<EVENTHANDLERFUNC>(OnKeyDownRepeat), nullptr, 7.0f);
|
||||
EventRegisterEx(EVENT_ID_MOUSEDOWN, reinterpret_cast<EVENTHANDLERFUNC>(OnMouseDown), nullptr, 7.0f);
|
||||
EventRegisterEx(EVENT_ID_MOUSEUP, reinterpret_cast<EVENTHANDLERFUNC>(OnMouseUp), nullptr, 7.0f);
|
||||
EventRegisterEx(EVENT_ID_MOUSEMOVE, reinterpret_cast<EVENTHANDLERFUNC>(OnMouseMove), nullptr, 7.0f);
|
||||
}
|
6
src/console/Handlers.hpp
Normal file
6
src/console/Handlers.hpp
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef CONSOLE_HANDLERS_HPP
|
||||
#define CONSOLE_HANDLERS_HPP
|
||||
|
||||
void RegisterHandlers();
|
||||
|
||||
#endif
|
@ -1,4 +1,5 @@
|
||||
#include "console/Screen.hpp"
|
||||
#include "console/Handlers.hpp"
|
||||
#include "console/Types.hpp"
|
||||
#include "gx/Buffer.hpp"
|
||||
#include "gx/Coordinate.hpp"
|
||||
@ -82,10 +83,6 @@ void PaintText(void* param, const RECTF* rect, const RECTF* visible, float elaps
|
||||
// TODO
|
||||
}
|
||||
|
||||
void RegisterHandlers() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void ConsoleScreenInitialize(const char* title) {
|
||||
CRect windowSize;
|
||||
GxCapsWindowSize(windowSize);
|
||||
|
Loading…
Reference in New Issue
Block a user