mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 08:42:45 +03:00
chore(event): tweak code style
This commit is contained in:
parent
c3813f9d88
commit
605cbda69d
@ -55,27 +55,28 @@ int32_t EventIsControlKeyDown() {
|
|||||||
int32_t EventIsKeyDown(KEY key) {
|
int32_t EventIsKeyDown(KEY key) {
|
||||||
auto hContext = PropGet(PROP_EVENTCONTEXT);
|
auto hContext = PropGet(PROP_EVENTCONTEXT);
|
||||||
auto contextId = *reinterpret_cast<uint32_t*>(hContext);
|
auto contextId = *reinterpret_cast<uint32_t*>(hContext);
|
||||||
int32_t findMask;
|
|
||||||
|
|
||||||
|
int32_t findMask;
|
||||||
auto context = TSingletonInstanceId<EvtContext, offsetof(EvtContext, m_id)>::s_idTable.Ptr(
|
auto context = TSingletonInstanceId<EvtContext, offsetof(EvtContext, m_id)>::s_idTable.Ptr(
|
||||||
contextId,
|
contextId,
|
||||||
0,
|
0,
|
||||||
&findMask
|
&findMask
|
||||||
);
|
);
|
||||||
|
|
||||||
if (context) {
|
if (!context) {
|
||||||
auto keystate = IEvtQueueCheckSyncKeyState(context, key);
|
return 0;
|
||||||
|
|
||||||
if (findMask != -1) {
|
|
||||||
TSingletonInstanceId<EvtContext, offsetof(EvtContext, m_id)>::s_idTable.Unlock(
|
|
||||||
findMask & (INSTANCE_TABLE_SLOT_COUNT - 1),
|
|
||||||
findMask >= INSTANCE_TABLE_SLOT_COUNT
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return keystate;
|
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
|
auto keystate = IEvtQueueCheckSyncKeyState(context, key);
|
||||||
|
|
||||||
|
if (findMask != -1) {
|
||||||
|
TSingletonInstanceId<EvtContext, offsetof(EvtContext, m_id)>::s_idTable.Unlock(
|
||||||
|
findMask & (INSTANCE_TABLE_SLOT_COUNT - 1),
|
||||||
|
findMask >= INSTANCE_TABLE_SLOT_COUNT
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return keystate;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t EventIsShiftKeyDown() {
|
int32_t EventIsShiftKeyDown() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user