1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

Simulate all keys being released when when game loses focus (#13336)

This commit is contained in:
Zardshard 2023-04-13 12:06:21 -04:00 committed by GitHub
parent fe75ec8d0d
commit e139749b5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 8 deletions

View file

@ -109,6 +109,12 @@ public:
bool handleEvent(const irr::SEvent::SJoystickEvent &ev);
void clear();
void releaseAllKeys()
{
m_keys_released |= m_keys_down;
m_keys_down.reset();
}
bool wasKeyDown(GameKeyType b)
{
bool r = m_past_keys_pressed[b];