mirror of
https://gitlab.com/c3d/db48x.git
synced 2024-09-29 05:36:58 +02:00
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:
parent
79760be3e4
commit
b1c9856611
3 changed files with 10 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue