|
|
@ -4594,7 +4594,24 @@ namespace olc |
|
|
|
{ bHasMouseFocus = state; } |
|
|
|
{ bHasMouseFocus = state; } |
|
|
|
|
|
|
|
|
|
|
|
void PixelGameEngine::olc_UpdateKeyFocus(bool state) |
|
|
|
void PixelGameEngine::olc_UpdateKeyFocus(bool state) |
|
|
|
{ bHasInputFocus = state; } |
|
|
|
{
|
|
|
|
|
|
|
|
bHasInputFocus = state; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!state){ //Drop all key and mouse inputs as we have lost input focus.
|
|
|
|
|
|
|
|
// Compare hardware input states from previous frame
|
|
|
|
|
|
|
|
auto ScanHardware = [&](HWButton* pKeys, bool* pStateOld, bool* pStateNew, uint32_t nKeyCount) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
for (uint32_t i = 0; i < nKeyCount; i++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if(pKeys==pKeyboardState)olc_UpdateKeyState(i,false); |
|
|
|
|
|
|
|
else if(pKeys==pMouseState)olc_UpdateMouseState(i,false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ScanHardware(pKeyboardState, pKeyOldState, pKeyNewState, 256); |
|
|
|
|
|
|
|
ScanHardware(pMouseState, pMouseOldState, pMouseNewState, nMouseButtons); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PixelGameEngine::olc_DropFiles(int32_t x, int32_t y, const std::vector<std::string>& vFiles) |
|
|
|
void PixelGameEngine::olc_DropFiles(int32_t x, int32_t y, const std::vector<std::string>& vFiles) |
|
|
|
{
|
|
|
|
{
|
|
|
|