mirror of https://github.com/mgba-emu/mgba.git
Qt: Clear active buttons when focus is lost
This commit is contained in:
parent
3384863382
commit
569e6ef7db
1
CHANGES
1
CHANGES
|
@ -47,6 +47,7 @@ Misc:
|
||||||
- Qt: Set default log level to FATAL, ERROR and WARN
|
- Qt: Set default log level to FATAL, ERROR and WARN
|
||||||
- Qt: Clarify some phrasing in the menus
|
- Qt: Clarify some phrasing in the menus
|
||||||
- GBA Memory: Implement 16- and 32-bit loads from SRAM
|
- GBA Memory: Implement 16- and 32-bit loads from SRAM
|
||||||
|
- Qt: Clear active buttons when focus is lost
|
||||||
|
|
||||||
0.1.0: (2014-12-13)
|
0.1.0: (2014-12-13)
|
||||||
- Initial release
|
- Initial release
|
||||||
|
|
|
@ -310,6 +310,11 @@ void GameController::keyReleased(int key) {
|
||||||
updateKeys();
|
updateKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GameController::clearKeys() {
|
||||||
|
m_activeKeys = 0;
|
||||||
|
updateKeys();
|
||||||
|
}
|
||||||
|
|
||||||
void GameController::setAudioBufferSamples(int samples) {
|
void GameController::setAudioBufferSamples(int samples) {
|
||||||
threadInterrupt();
|
threadInterrupt();
|
||||||
redoSamples(samples);
|
redoSamples(samples);
|
||||||
|
|
|
@ -82,6 +82,7 @@ public slots:
|
||||||
void frameAdvance();
|
void frameAdvance();
|
||||||
void keyPressed(int key);
|
void keyPressed(int key);
|
||||||
void keyReleased(int key);
|
void keyReleased(int key);
|
||||||
|
void clearKeys();
|
||||||
void setAudioBufferSamples(int samples);
|
void setAudioBufferSamples(int samples);
|
||||||
void setFPSTarget(float fps);
|
void setFPSTarget(float fps);
|
||||||
void loadState(int slot);
|
void loadState(int slot);
|
||||||
|
|
|
@ -306,6 +306,11 @@ void Window::closeEvent(QCloseEvent* event) {
|
||||||
QMainWindow::closeEvent(event);
|
QMainWindow::closeEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Window::focusOutEvent(QFocusEvent*) {
|
||||||
|
m_controller->setTurbo(false, false);
|
||||||
|
m_controller->clearKeys();
|
||||||
|
}
|
||||||
|
|
||||||
void Window::toggleFullScreen() {
|
void Window::toggleFullScreen() {
|
||||||
if (isFullScreen()) {
|
if (isFullScreen()) {
|
||||||
showNormal();
|
showNormal();
|
||||||
|
|
|
@ -86,6 +86,7 @@ protected:
|
||||||
virtual void keyReleaseEvent(QKeyEvent* event) override;
|
virtual void keyReleaseEvent(QKeyEvent* event) override;
|
||||||
virtual void resizeEvent(QResizeEvent*) override;
|
virtual void resizeEvent(QResizeEvent*) override;
|
||||||
virtual void closeEvent(QCloseEvent*) override;
|
virtual void closeEvent(QCloseEvent*) override;
|
||||||
|
virtual void focusOutEvent(QFocusEvent*) override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void gameStarted(GBAThread*);
|
void gameStarted(GBAThread*);
|
||||||
|
|
Loading…
Reference in New Issue