diff --git a/src/debugger/gui/DebuggerDialog.cxx b/src/debugger/gui/DebuggerDialog.cxx index 38cca0cba..c61ed9a18 100644 --- a/src/debugger/gui/DebuggerDialog.cxx +++ b/src/debugger/gui/DebuggerDialog.cxx @@ -124,53 +124,53 @@ void DebuggerDialog::handleKeyDown(StellaKey key, StellaMod mod) instance().console().toggleP0Collision(); else instance().console().toggleP0Bit(); - break; + return; case KBDK_X: if(StellaModTest::isShift(mod)) instance().console().toggleP1Collision(); else instance().console().toggleP1Bit(); - break; + return; case KBDK_C: if(StellaModTest::isShift(mod)) instance().console().toggleM0Collision(); else instance().console().toggleM0Bit(); - break; + return; case KBDK_V: if(StellaModTest::isShift(mod)) instance().console().toggleM1Collision(); else instance().console().toggleM1Bit(); - break; + return; case KBDK_B: if(StellaModTest::isShift(mod)) instance().console().toggleBLCollision(); else instance().console().toggleBLBit(); - break; + return; case KBDK_N: if(StellaModTest::isShift(mod)) instance().console().togglePFCollision(); else instance().console().togglePFBit(); - break; + return; case KBDK_COMMA: instance().console().toggleFixedColors(); - break; + return; case KBDK_PERIOD: if(StellaModTest::isShift(mod)) instance().console().toggleCollisions(); else instance().console().toggleBits(); - break; + return; case KBDK_T: // Alt-t toggles Time Machine instance().state().toggleTimeMachine(); diff --git a/src/gui/AudioDialog.cxx b/src/gui/AudioDialog.cxx index 1fcae59df..6450a973e 100644 --- a/src/gui/AudioDialog.cxx +++ b/src/gui/AudioDialog.cxx @@ -43,8 +43,7 @@ AudioDialog::AudioDialog(OSystem& osystem, DialogContainer& parent, const int INDENT = 20; const int VGAP = 4; const int lineHeight = font.getLineHeight(), - fontWidth = font.getMaxCharWidth(), - fontHeight = font.getFontHeight(); + fontWidth = font.getMaxCharWidth(); int xpos, ypos; int lwidth = font.getStringWidth("Volume "), pwidth; diff --git a/src/gui/DialogContainer.cxx b/src/gui/DialogContainer.cxx index 1d3aab8a2..fbd2a92ba 100644 --- a/src/gui/DialogContainer.cxx +++ b/src/gui/DialogContainer.cxx @@ -58,9 +58,9 @@ void DialogContainer::updateTime(uInt64 time) Dialog* activeDialog = myDialogStack.top(); // Key still pressed - if(myCurrentKeyDown.keycode != 0 && myKeyRepeatTime < myTime) + if(myCurrentKeyDown.key != KBDK_UNKNOWN && myKeyRepeatTime < myTime) { - activeDialog->handleKeyDown(myCurrentKeyDown.keycode, myCurrentKeyDown.flags); + activeDialog->handleKeyDown(myCurrentKeyDown.key, myCurrentKeyDown.mod); myKeyRepeatTime = myTime + kRepeatSustainDelay; } @@ -184,8 +184,8 @@ void DialogContainer::handleKeyEvent(StellaKey key, StellaMod mod, bool state) Dialog* activeDialog = myDialogStack.top(); if(state) { - myCurrentKeyDown.keycode = key; - myCurrentKeyDown.flags = mod; + myCurrentKeyDown.key = key; + myCurrentKeyDown.mod = mod; myKeyRepeatTime = myTime + kRepeatInitialDelay; activeDialog->handleKeyDown(key, mod); @@ -195,8 +195,8 @@ void DialogContainer::handleKeyEvent(StellaKey key, StellaMod mod, bool state) activeDialog->handleKeyUp(key, mod); // Only stop firing events if it's the current key - if (key == myCurrentKeyDown.keycode) - myCurrentKeyDown.keycode = KBDK_UNKNOWN; + if(key == myCurrentKeyDown.key) + myCurrentKeyDown.key = KBDK_UNKNOWN; } } @@ -363,7 +363,8 @@ void DialogContainer::handleJoyHatEvent(int stick, int hat, JoyHat value) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void DialogContainer::reset() { - myCurrentKeyDown.keycode = KBDK_UNKNOWN; + myCurrentKeyDown.key = KBDK_UNKNOWN; + myCurrentKeyDown.mod = KBDM_NONE; myCurrentMouseDown.b = MouseButton::NONE; myLastClick.x = myLastClick.y = 0; myLastClick.time = 0; diff --git a/src/gui/DialogContainer.hxx b/src/gui/DialogContainer.hxx index 6905e3c86..b6cfe01ed 100644 --- a/src/gui/DialogContainer.hxx +++ b/src/gui/DialogContainer.hxx @@ -179,8 +179,8 @@ class DialogContainer // For continuous 'key down' events struct { - StellaKey keycode; - StellaMod flags; + StellaKey key; + StellaMod mod; } myCurrentKeyDown; uInt64 myKeyRepeatTime;