mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-04-18 02:52:47 +03:00
feat(event): process focus input
This commit is contained in:
parent
27cab4814c
commit
2b791973b5
@ -75,6 +75,18 @@ void PostClose() {
|
|||||||
EventInitiateShutdown();
|
EventInitiateShutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PostFocus(EvtContext* context, int32_t focus) {
|
||||||
|
Input::s_buttonState = 0;
|
||||||
|
Input::s_metaKeyState = 0;
|
||||||
|
|
||||||
|
EVENT_DATA_FOCUS data;
|
||||||
|
data.focus = focus;
|
||||||
|
|
||||||
|
IEvtQueueDispatch(context, EVENT_ID_FOCUS, &data);
|
||||||
|
|
||||||
|
CheckMouseModeState();
|
||||||
|
}
|
||||||
|
|
||||||
void PostKeyDown(EvtContext* context, int32_t key, int32_t repeat, int32_t time) {
|
void PostKeyDown(EvtContext* context, int32_t key, int32_t repeat, int32_t time) {
|
||||||
if (key <= KEY_LASTMETAKEY) {
|
if (key <= KEY_LASTMETAKEY) {
|
||||||
if ((1 << key) & Input::s_metaKeyState) {
|
if ((1 << key) & Input::s_metaKeyState) {
|
||||||
@ -216,7 +228,11 @@ void ProcessInput(const int32_t param[], OSINPUT id, int32_t* shutdown, EvtConte
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case OS_INPUT_FOCUS:
|
case OS_INPUT_FOCUS:
|
||||||
// TODO
|
PostFocus(
|
||||||
|
context,
|
||||||
|
param[0]
|
||||||
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OS_INPUT_KEY_DOWN:
|
case OS_INPUT_KEY_DOWN:
|
||||||
|
@ -220,6 +220,10 @@ struct EVENT_DATA_CHAR {
|
|||||||
uint32_t repeat;
|
uint32_t repeat;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct EVENT_DATA_FOCUS {
|
||||||
|
int32_t focus;
|
||||||
|
};
|
||||||
|
|
||||||
struct EVENT_DATA_IDLE {
|
struct EVENT_DATA_IDLE {
|
||||||
float elapsedSec;
|
float elapsedSec;
|
||||||
uint32_t time;
|
uint32_t time;
|
||||||
|
Loading…
Reference in New Issue
Block a user