support F12 (snapshot) in TM UI too (implements #679)

This commit is contained in:
thrust26 2020-07-22 10:29:23 +02:00
parent f9194bbfb4
commit 93494fc7d3
2 changed files with 12 additions and 2 deletions

View File

@ -25,6 +25,7 @@
#include "StateManager.hxx"
#include "RewindManager.hxx"
#include "TimeLineWidget.hxx"
#include "TIASurface.hxx"
#include "Console.hxx"
#include "TIA.hxx"
@ -297,6 +298,8 @@ void TimeMachineDialog::handleKeyDown(StellaKey key, StellaMod mod, bool repeate
// The following 'Alt' shortcuts duplicate the shortcuts in EventHandler
// It is best to keep them the same, so changes in EventHandler mean we
// need to update the logic here too
// Note: The hotkeys can be remapped in emulation mode, but this will not
// affect the fixed hotkeys here.
if(StellaModTest::isAlt(mod))
{
switch(key)
@ -323,6 +326,8 @@ void TimeMachineDialog::handleKeyDown(StellaKey key, StellaMod mod, bool repeate
}
else if(key == KBDK_SPACE || key == KBDK_ESCAPE)
handleCommand(nullptr, kPlay, 0, 0);
else if (key == KBDK_F12)
handleCommand(nullptr, kSnapShot, 0, 0);
else
Dialog::handleKeyDown(key, mod);
}
@ -383,6 +388,10 @@ void TimeMachineDialog::handleCommand(CommandSender* sender, int cmd,
initBar();
break;
case kSnapShot:
instance().frameBuffer().tiaSurface().saveSnapShot();
break;
default:
Dialog::handleCommand(sender, cmd, data, 0);
}

View File

@ -65,8 +65,9 @@ class TimeMachineDialog : public Dialog
kUnwindAll = 'TMua',
kUnwind10 = 'TMu1',
kUnwind1 = 'TMun',
kSaveAll = 'TMsv',
kLoadAll = 'TMld',
kSaveAll = 'TMsv',
kLoadAll = 'TMld',
kSnapShot = 'TMsn',
};
TimeLineWidget* myTimeline{nullptr};