simulator: Add F8 key to save state in the simulator

This is a shortcut to save the current state.
Note that you can also get that with RSHIFT-EXIT.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
This commit is contained in:
Christophe de Dinechin 2024-03-20 22:33:53 +01:00
parent 79760be3e4
commit b1c9856611
3 changed files with 10 additions and 2 deletions

View file

@ -405,6 +405,12 @@ void MainWindow::keyPressEvent(QKeyEvent * ev)
return;
}
if (k == Qt::Key_F8)
{
key_push(tests::SAVE_PGM);
return;
}
if (k == Qt::Key_Shift)
{
shift_held = true;

View file

@ -373,13 +373,14 @@ extern "C" void program_main()
}
#if SIMULATOR
if (key == tests::EXIT_PGM)
if (key == tests::EXIT_PGM || key == tests::SAVE_PGM)
{
cstring path = get_reset_state_file();
printf("Exit: saving state to %s\n", path);
if (path && *path)
save_state_file(path);
break;
if (key == tests::EXIT_PGM)
break;
}
if (key == tests::KEYSYNC)
{

View file

@ -203,6 +203,7 @@ struct tests
KEYSYNC = 104, // Wait for other side to process keys
LONGPRESS = 105, // Force long press
EXIT_PGM = 106, // Exiting program
SAVE_PGM = 107, // Save program on the RPL thread
// Reaching a specific shift state
NOSHIFT = 110, // Clear shifts