Remove key repeat functionality from DialogContainer.

It is now provided by the backend (SDL) directly.
This commit is contained in:
Stephen Anthony 2019-06-01 18:41:38 -02:30
parent dd88e3a7fe
commit 0a1a0979fb
2 changed files with 0 additions and 29 deletions

View File

@ -29,7 +29,6 @@
DialogContainer::DialogContainer(OSystem& osystem)
: myOSystem(osystem),
myTime(0),
myKeyRepeatTime(0),
myClickRepeatTime(0),
myButtonRepeatTime(0),
myAxisRepeatTime(0),
@ -50,13 +49,6 @@ void DialogContainer::updateTime(uInt64 time)
// Check for pending continuous events and send them to the active dialog box
Dialog* activeDialog = myDialogStack.top();
// Key still pressed
if(myCurrentKeyDown.key != KBDK_UNKNOWN && myKeyRepeatTime < myTime)
{
activeDialog->handleKeyDown(myCurrentKeyDown.key, myCurrentKeyDown.mod);
myKeyRepeatTime = myTime + kRepeatSustainDelay;
}
// Mouse button still pressed
if(myCurrentMouseDown.b != MouseButton::NONE && myClickRepeatTime < myTime)
{
@ -185,21 +177,9 @@ void DialogContainer::handleKeyEvent(StellaKey key, StellaMod mod, bool pressed,
// Send the event to the dialog box on the top of the stack
Dialog* activeDialog = myDialogStack.top();
if(pressed)
{
myCurrentKeyDown.key = key;
myCurrentKeyDown.mod = mod;
myKeyRepeatTime = myTime + kRepeatInitialDelay;
activeDialog->handleKeyDown(key, mod);
}
else
{
activeDialog->handleKeyUp(key, mod);
// Only stop firing events if it's the current key
if(key == myCurrentKeyDown.key)
myCurrentKeyDown.key = KBDK_UNKNOWN;
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -365,8 +345,6 @@ void DialogContainer::handleJoyHatEvent(int stick, int hat, JoyHat value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DialogContainer::reset()
{
myCurrentKeyDown.key = KBDK_UNKNOWN;
myCurrentKeyDown.mod = KBDM_NONE;
myCurrentMouseDown.b = MouseButton::NONE;
myLastClick.x = myLastClick.y = 0;
myLastClick.time = 0;

View File

@ -182,13 +182,6 @@ class DialogContainer
// Indicates the most current time (in milliseconds) as set by updateTime()
uInt64 myTime;
// For continuous 'key down' events
struct {
StellaKey key;
StellaMod mod;
} myCurrentKeyDown;
uInt64 myKeyRepeatTime;
// For continuous 'mouse down' events
struct {
int x;