mirror of https://github.com/stella-emu/stella.git
Merge branch 'master' of https://github.com/stella-emu/stella
This commit is contained in:
commit
3e4ff679c2
|
@ -29,7 +29,6 @@
|
||||||
DialogContainer::DialogContainer(OSystem& osystem)
|
DialogContainer::DialogContainer(OSystem& osystem)
|
||||||
: myOSystem(osystem),
|
: myOSystem(osystem),
|
||||||
myTime(0),
|
myTime(0),
|
||||||
myKeyRepeatTime(0),
|
|
||||||
myClickRepeatTime(0),
|
myClickRepeatTime(0),
|
||||||
myButtonRepeatTime(0),
|
myButtonRepeatTime(0),
|
||||||
myAxisRepeatTime(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
|
// Check for pending continuous events and send them to the active dialog box
|
||||||
Dialog* activeDialog = myDialogStack.top();
|
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
|
// Mouse button still pressed
|
||||||
if(myCurrentMouseDown.b != MouseButton::NONE && myClickRepeatTime < myTime)
|
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
|
// Send the event to the dialog box on the top of the stack
|
||||||
Dialog* activeDialog = myDialogStack.top();
|
Dialog* activeDialog = myDialogStack.top();
|
||||||
if(pressed)
|
if(pressed)
|
||||||
{
|
|
||||||
myCurrentKeyDown.key = key;
|
|
||||||
myCurrentKeyDown.mod = mod;
|
|
||||||
myKeyRepeatTime = myTime + kRepeatInitialDelay;
|
|
||||||
|
|
||||||
activeDialog->handleKeyDown(key, mod);
|
activeDialog->handleKeyDown(key, mod);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
activeDialog->handleKeyUp(key, mod);
|
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()
|
void DialogContainer::reset()
|
||||||
{
|
{
|
||||||
myCurrentKeyDown.key = KBDK_UNKNOWN;
|
|
||||||
myCurrentKeyDown.mod = KBDM_NONE;
|
|
||||||
myCurrentMouseDown.b = MouseButton::NONE;
|
myCurrentMouseDown.b = MouseButton::NONE;
|
||||||
myLastClick.x = myLastClick.y = 0;
|
myLastClick.x = myLastClick.y = 0;
|
||||||
myLastClick.time = 0;
|
myLastClick.time = 0;
|
||||||
|
|
|
@ -182,13 +182,6 @@ class DialogContainer
|
||||||
// Indicates the most current time (in milliseconds) as set by updateTime()
|
// Indicates the most current time (in milliseconds) as set by updateTime()
|
||||||
uInt64 myTime;
|
uInt64 myTime;
|
||||||
|
|
||||||
// For continuous 'key down' events
|
|
||||||
struct {
|
|
||||||
StellaKey key;
|
|
||||||
StellaMod mod;
|
|
||||||
} myCurrentKeyDown;
|
|
||||||
uInt64 myKeyRepeatTime;
|
|
||||||
|
|
||||||
// For continuous 'mouse down' events
|
// For continuous 'mouse down' events
|
||||||
struct {
|
struct {
|
||||||
int x;
|
int x;
|
||||||
|
|
Loading…
Reference in New Issue