win32: add hotkey for limit framerate limit toggle

This commit is contained in:
zeromus 2011-08-11 04:12:36 +00:00
parent 1d8ec4bb5e
commit 312628821f
6 changed files with 15 additions and 2 deletions

View File

@ -412,6 +412,11 @@ void HK_FastForwardKeyDown(int, bool justPressed) { FastForward = 1; }
void HK_FastForwardKeyUp(int) { FastForward = 0; }
void HK_IncreaseSpeed(int, bool justPressed) { IncreaseSpeed(); }
void HK_DecreaseSpeed(int, bool justPressed) { DecreaseSpeed(); }
void HK_FrameLimitToggle(int, bool justPressed) {
FrameLimit ^= 1;
WritePrivateProfileInt("FrameLimit", "FrameLimit", FrameLimit, IniName);
}
void HK_FrameAdvanceKeyDown(int, bool justPressed) { FrameAdvance(true); }
void HK_FrameAdvanceKeyUp(int) { FrameAdvance(false); }
@ -518,6 +523,12 @@ void InitCustomKeys (SCustomKeys *keys)
keys->DecreaseSpeed.page = HOTKEY_PAGE_MAIN;
keys->DecreaseSpeed.key = VK_OEM_MINUS;
keys->FrameLimitToggle.handleKeyDown = HK_FrameLimitToggle;
keys->FrameLimitToggle.code = "FrameLimitToggle";
keys->FrameLimitToggle.name = STRW(ID_LABEL_HK8b);
keys->FrameLimitToggle.page = HOTKEY_PAGE_MAIN;
keys->FrameLimitToggle.key = NULL;
keys->IncreasePressure.handleKeyDown = HK_IncreasePressure;
keys->IncreasePressure.code = "IncreasePressure";
keys->IncreasePressure.name = STRW(ID_LABEL_HK55);

View File

@ -68,7 +68,7 @@ struct SCustomKeys
SCustomKey Slot[10];
SCustomKey QuickSave, QuickLoad, NextSaveSlot, PreviousSaveSlot;
SCustomKey OpenROM, ReloadROM, Reset, Pause, FrameAdvance, FastForward, FastForwardToggle, IncreaseSpeed, DecreaseSpeed, Microphone, IncreasePressure, DecreasePressure;
SCustomKey OpenROM, ReloadROM, Reset, Pause, FrameAdvance, FastForward, FastForwardToggle, IncreaseSpeed, DecreaseSpeed, FrameLimitToggle, Microphone, IncreasePressure, DecreasePressure;
SCustomKey PlayMovie, RecordMovie, StopMovie, ToggleReadOnly;

View File

@ -405,7 +405,7 @@ UINT currLanguageMenuItem = IDC_LANGENGLISH;
extern HWND RamSearchHWnd;
static bool lostFocusPause = true;
static bool lastPauseFromLostFocus = false;
static bool FrameLimit = true;
bool FrameLimit = true;
extern bool allowBackgroundInput;
std::vector<HWND> LuaScriptHWnds;

View File

@ -725,6 +725,7 @@
#define ID_LABEL_HK7 4471
#define IDC_GI_TITLEFR 4472
#define ID_LABEL_HK8 4472
#define ID_LABEL_HK8b 44720
#define IDC_GI_TITLEGE 4473
#define ID_LABEL_HK9 4473
#define IDC_GI_TITLEIT 4474

Binary file not shown.

View File

@ -2,6 +2,7 @@
#define _THROTTLE_H_
extern int FastForward;
extern bool FrameLimit;
void IncreaseSpeed();
void DecreaseSpeed();