mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2026-11-26 07:33:38 +03:00
feat(event): implement OsInputGet for windows
This commit is contained in:
1 parent
788dde31ef
commit
885eeeabd8
7 files changed
+51
-4
No files matched your search
+2
-2
@@ -19,8 +19,6 @@
|
|||||||
|
|
||||||
namespace Input {
|
namespace Input {
|
||||||
CRect s_boundingRect;
|
CRect s_boundingRect;
|
||||||
int32_t s_queueHead;
|
|
||||||
int32_t s_queueTail;
|
|
||||||
OSEVENT s_queue[32];
|
OSEVENT s_queue[32];
|
||||||
|
|
||||||
MOUSEBUTTON s_buttonConversion[16] = {
|
MOUSEBUTTON s_buttonConversion[16] = {
|
||||||
@@ -51,6 +49,8 @@ MOUSEMODE Input::s_mouseMode;
|
|||||||
int32_t Input::s_numlockState;
|
int32_t Input::s_numlockState;
|
||||||
int32_t Input::s_simulatedRightButtonClick;
|
int32_t Input::s_simulatedRightButtonClick;
|
||||||
uint32_t Input::s_metaKeyState;
|
uint32_t Input::s_metaKeyState;
|
||||||
|
int32_t Input::s_queueHead;
|
||||||
|
int32_t Input::s_queueTail;
|
||||||
|
|
||||||
#if defined(WHOA_SYSTEM_WIN)
|
#if defined(WHOA_SYSTEM_WIN)
|
||||||
int32_t Input::s_savedMouseSpeed;
|
int32_t Input::s_savedMouseSpeed;
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ namespace Input {
|
|||||||
extern int32_t s_numlockState;
|
extern int32_t s_numlockState;
|
||||||
extern int32_t s_simulatedRightButtonClick;
|
extern int32_t s_simulatedRightButtonClick;
|
||||||
extern uint32_t s_metaKeyState;
|
extern uint32_t s_metaKeyState;
|
||||||
|
extern int32_t s_queueHead;
|
||||||
|
extern int32_t s_queueTail;
|
||||||
|
|
||||||
#if defined(WHOA_SYSTEM_WIN)
|
#if defined(WHOA_SYSTEM_WIN)
|
||||||
extern int32_t s_savedMouseSpeed;
|
extern int32_t s_savedMouseSpeed;
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
int32_t OsGuiProcessMessage(void* message);
|
||||||
|
|
||||||
int32_t OsWindowProc(void* window, uint32_t message, uintptr_t wparam, intptr_t lparam);
|
int32_t OsWindowProc(void* window, uint32_t message, uintptr_t wparam, intptr_t lparam);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
#include "event/Window.hpp"
|
#include "event/Window.hpp"
|
||||||
|
|
||||||
|
int32_t OsGuiProcessMessage(void* message) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int32_t OsWindowProc(void* window, uint32_t message, uintptr_t wparam, intptr_t lparam) {
|
int32_t OsWindowProc(void* window, uint32_t message, uintptr_t wparam, intptr_t lparam) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
#include "event/Window.hpp"
|
#include "event/Window.hpp"
|
||||||
|
|
||||||
|
int32_t OsGuiProcessMessage(void* message) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int32_t OsWindowProc(void* window, uint32_t message, uintptr_t wparam, intptr_t lparam) {
|
int32_t OsWindowProc(void* window, uint32_t message, uintptr_t wparam, intptr_t lparam) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
+32
-2
@@ -1,6 +1,36 @@
|
|||||||
#include "event/Input.hpp"
|
#include "event/Input.hpp"
|
||||||
|
#include "event/Window.hpp"
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
int32_t OsInputGet(OSINPUT* id, int32_t* param0, int32_t* param1, int32_t* param2, int32_t* param3) {
|
int32_t OsInputGet(OSINPUT* id, int32_t* param0, int32_t* param1, int32_t* param2, int32_t* param3) {
|
||||||
// TODO
|
// TODO window rect comparisons
|
||||||
return 0;
|
|
||||||
|
while (Input::s_queueTail == Input::s_queueHead) {
|
||||||
|
MSG msg;
|
||||||
|
|
||||||
|
if (!PeekMessage(&msg, nullptr, 0, 0, 0)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!GetMessage(&msg, nullptr, 0, 0)) {
|
||||||
|
*id = OS_INPUT_SHUTDOWN;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (OsGuiProcessMessage(&msg)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Input::s_queueTail != Input::s_queueHead) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
TranslateMessage(&msg);
|
||||||
|
|
||||||
|
DispatchMessage(&msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
OsQueueGet(id, param0, param1, param2, param3);
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,11 @@
|
|||||||
#include "event/Input.hpp"
|
#include "event/Input.hpp"
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
int32_t OsGuiProcessMessage(void* message) {
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int32_t OsWindowProc(void* window, uint32_t message, uintptr_t wparam, intptr_t lparam) {
|
int32_t OsWindowProc(void* window, uint32_t message, uintptr_t wparam, intptr_t lparam) {
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user