diff --git a/desmume/src/windows/hotkey.cpp b/desmume/src/windows/hotkey.cpp index 4c0dbffa0..fc8d4f75b 100644 --- a/desmume/src/windows/hotkey.cpp +++ b/desmume/src/windows/hotkey.cpp @@ -131,7 +131,9 @@ void HK_StateQuickLoadSlot(int) } void HK_Pause(int) { Pause(); } -void HK_FastForward(int) { FastForward ^=1; } +void HK_FastForwardToggle(int) { FastForward ^=1; } +void HK_FastForwardKeyDown(int) { FastForward = 1; } +void HK_FastForwardKeyUp(int) { FastForward = 0; } void HK_IncreaseSpeed(int) { IncreaseSpeed(); } void HK_DecreaseSpeed(int) { DecreaseSpeed(); } void HK_FrameAdvance(int) { FrameAdvance(); } @@ -172,12 +174,19 @@ void InitCustomKeys (SCustomKeys *keys) keys->Pause.page = HOTKEY_PAGE_MAIN; keys->Pause.key = VK_SPACE; - keys->FastForward.handleKeyDown = HK_FastForward; + keys->FastForward.handleKeyDown = HK_FastForwardKeyDown; + keys->FastForward.handleKeyUp = HK_FastForwardKeyUp; keys->FastForward.code = "FastForward"; keys->FastForward.name = L"Fast Forward"; keys->FastForward.page = HOTKEY_PAGE_MAIN; keys->FastForward.key = VK_TAB; + keys->FastForwardToggle.handleKeyDown = HK_FastForwardToggle; + keys->FastForwardToggle.code = "FastForwardToggle"; + keys->FastForwardToggle.name = L"Fast Forward Toggle"; + keys->FastForwardToggle.page = HOTKEY_PAGE_MAIN; + keys->FastForwardToggle.key = NULL; + keys->IncreaseSpeed.handleKeyDown = HK_IncreaseSpeed; keys->IncreaseSpeed.code = "IncreaseSpeed"; keys->IncreaseSpeed.name = L"Increase Speed"; diff --git a/desmume/src/windows/hotkey.h b/desmume/src/windows/hotkey.h index cd349745b..fcfccbbe6 100644 --- a/desmume/src/windows/hotkey.h +++ b/desmume/src/windows/hotkey.h @@ -63,7 +63,7 @@ struct SCustomKeys SCustomKey Slot[10]; SCustomKey QuickSave, QuickLoad; - SCustomKey Pause, FrameAdvance, FastForward, IncreaseSpeed, DecreaseSpeed; + SCustomKey Pause, FrameAdvance, FastForward, FastForwardToggle, IncreaseSpeed, DecreaseSpeed; SCustomKey ToggleRasterizer; diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index 2249bd8f1..28514dc17 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -2277,6 +2277,8 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM return 0; break; } + case WM_KEYUP: + case WM_SYSKEYUP: case WM_CUSTKEYUP: { int modifiers = GetModifiers(wParam);