For Qt GUI, added hot keys for certain emulation speed presets. Presets are: 1/4x, 1/2x, Normal 1x, 2x, 4x, 8x, and 16x. These hot keys can be mapped to gamepads using advanced key bindings.

This commit is contained in:
harry 2023-11-30 21:09:52 -05:00
parent 8600679636
commit 72b949efcd
3 changed files with 31 additions and 0 deletions

View File

@ -855,6 +855,14 @@ void consoleWin_t::initHotKeys(void)
Hotkeys[HK_FRAME_ADVANCE].getShortcut()->setEnabled(false);
Hotkeys[HK_TURBO ].getShortcut()->setEnabled(false);
connect( Hotkeys[ HK_SPEED_QUARTER ].getShortcut(), &QShortcut::activated, [] { CustomEmulationSpeed( 25); } );
connect( Hotkeys[ HK_SPEED_HALF ].getShortcut(), &QShortcut::activated, [] { CustomEmulationSpeed( 50); } );
connect( Hotkeys[ HK_SPEED_NORMAL ].getShortcut(), &QShortcut::activated, [] { CustomEmulationSpeed( 100); } );
connect( Hotkeys[ HK_SPEED_2X ].getShortcut(), &QShortcut::activated, [] { CustomEmulationSpeed( 200); } );
connect( Hotkeys[ HK_SPEED_4X ].getShortcut(), &QShortcut::activated, [] { CustomEmulationSpeed( 400); } );
connect( Hotkeys[ HK_SPEED_8X ].getShortcut(), &QShortcut::activated, [] { CustomEmulationSpeed( 800); } );
connect( Hotkeys[ HK_SPEED_16X ].getShortcut(), &QShortcut::activated, [] { CustomEmulationSpeed(1600); } );
connect( Hotkeys[ HK_VOLUME_MUTE ].getShortcut(), SIGNAL(activated()), this, SLOT(muteSoundVolume(void)) );
connect( Hotkeys[ HK_VOLUME_DOWN ].getShortcut(), SIGNAL(activated()), this, SLOT(decrSoundVolume(void)) );
connect( Hotkeys[ HK_VOLUME_UP ].getShortcut(), SIGNAL(activated()), this, SLOT(incrSoundVolume(void)) );

View File

@ -214,6 +214,27 @@ int getHotKeyConfig( int i, const char **nameOut, const char **keySeqOut, const
case HK_TURBO:
name = "Turbo"; keySeq = "Tab"; group = "Speed";
break;
case HK_SPEED_NORMAL:
name = "Normal Speed"; keySeq = ""; group = "Speed";
break;
case HK_SPEED_QUARTER:
name = "1/4x Speed"; keySeq = ""; group = "Speed";
break;
case HK_SPEED_HALF:
name = "1/2x Speed"; keySeq = ""; group = "Speed";
break;
case HK_SPEED_2X:
name = "2x Speed"; keySeq = ""; group = "Speed";
break;
case HK_SPEED_4X:
name = "4x Speed"; keySeq = ""; group = "Speed";
break;
case HK_SPEED_8X:
name = "8x Speed"; keySeq = ""; group = "Speed";
break;
case HK_SPEED_16X:
name = "16x Speed"; keySeq = ""; group = "Speed";
break;
case HK_TOGGLE_INPUT_DISPLAY:
name = "ToggleInputDisplay"; keySeq = ","; group = "Misc";
break;

View File

@ -18,6 +18,8 @@ enum HOTKEY {
// Emulation Execution Control
HK_FRAME_ADVANCE, HK_DECREASE_SPEED, HK_INCREASE_SPEED, HK_TURBO,
HK_SPEED_QUARTER, HK_SPEED_HALF, HK_SPEED_NORMAL,
HK_SPEED_2X, HK_SPEED_4X, HK_SPEED_8X, HK_SPEED_16X,
// Save States
HK_SAVE_STATE,