mirror of https://github.com/mgba-emu/mgba.git
Qt: Poll current keys in case some external force has changed them
This commit is contained in:
parent
af043e0792
commit
6f09085676
|
@ -859,6 +859,7 @@ void CoreController::addKey(int key) {
|
|||
|
||||
void CoreController::clearKey(int key) {
|
||||
m_activeKeys &= ~(1 << key);
|
||||
m_removedKeys |= 1 << key;
|
||||
}
|
||||
|
||||
void CoreController::setAutofire(int key, bool enable) {
|
||||
|
@ -1145,7 +1146,10 @@ void CoreController::setFramebufferHandle(int fb) {
|
|||
}
|
||||
|
||||
void CoreController::updateKeys() {
|
||||
int activeKeys = m_activeKeys | updateAutofire() | m_inputController->pollEvents();
|
||||
int polledKeys = m_inputController->pollEvents() | updateAutofire();
|
||||
int activeKeys = m_activeKeys | polledKeys;
|
||||
activeKeys |= m_threadContext.core->getKeys(m_threadContext.core) & ~m_removedKeys;
|
||||
m_removedKeys = polledKeys;
|
||||
m_threadContext.core->setKeys(m_threadContext.core, activeKeys);
|
||||
}
|
||||
|
||||
|
|
|
@ -265,6 +265,7 @@ private:
|
|||
QMutex m_bufferMutex;
|
||||
|
||||
int m_activeKeys = 0;
|
||||
int m_removedKeys = 0;
|
||||
bool m_autofire[32] = {};
|
||||
int m_autofireStatus[32] = {};
|
||||
int m_autofireThreshold = 1;
|
||||
|
|
Loading…
Reference in New Issue