From 6e3963d1cadbc89025fd34b0d5a510b5c5f1056d Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 12 Apr 2009 19:31:52 +0000 Subject: [PATCH] Added Hotkeys for Display FPS, Input, and Frame Counter --- desmume/src/windows/hotkey.cpp | 24 ++++++++++++++++++++++++ desmume/src/windows/hotkey.h | 3 +++ desmume/src/windows/main.h | 4 ++++ 3 files changed, 31 insertions(+) diff --git a/desmume/src/windows/hotkey.cpp b/desmume/src/windows/hotkey.cpp index 12f57111e..eb483ea8e 100644 --- a/desmume/src/windows/hotkey.cpp +++ b/desmume/src/windows/hotkey.cpp @@ -157,6 +157,9 @@ void HK_AutoHoldClearKeyDown(int) { } } +void HK_ToggleFrame(int) {frameCounterDisplay ^= true;} +void HK_ToggleFPS(int) {FpsDisplay ^= true;} +void HK_ToggleInput(int) {ShowInputDisplay ^= true;} void HK_ToggleLag(int) {ShowLagFrameCounter ^= true;} void HK_AutoHoldKeyDown(int) {AutoHoldPressed = true;} @@ -230,6 +233,27 @@ void InitCustomKeys (SCustomKeys *keys) i++; }; + + + + keys->ToggleFrameCounter.handleKeyDown = HK_ToggleFrame; + keys->ToggleFrameCounter.code = "Toggle Frame Display"; + keys->ToggleFrameCounter.name = L"Toggle Frame Display"; + keys->ToggleFrameCounter.page = HOTKEY_PAGE_MAIN; + keys->ToggleFrameCounter.key = VK_OEM_PERIOD; + + keys->ToggleFPS.handleKeyDown = HK_ToggleFPS; + keys->ToggleFPS.code = "Toggle FPS Display"; + keys->ToggleFPS.name = L"Toggle FPS Display"; + keys->ToggleFPS.page = HOTKEY_PAGE_MAIN; + keys->ToggleFPS.key = NULL; + + keys->ToggleInput.handleKeyDown = HK_ToggleInput; + keys->ToggleInput.code = "Toggle Input Display"; + keys->ToggleInput.name = L"Toggle Input Display"; + keys->ToggleInput.page = HOTKEY_PAGE_MAIN; + keys->ToggleInput.key = VK_OEM_COMMA; + keys->ToggleLag.handleKeyDown = HK_ToggleLag; keys->ToggleLag.code = "Toggle Lag Display"; keys->ToggleLag.name = L"Toggle Lag Display"; diff --git a/desmume/src/windows/hotkey.h b/desmume/src/windows/hotkey.h index 7ebc969f8..9aebc2a59 100644 --- a/desmume/src/windows/hotkey.h +++ b/desmume/src/windows/hotkey.h @@ -74,6 +74,9 @@ struct SCustomKeys SCustomKey ToggleRasterizer; SCustomKey PrintScreen; + SCustomKey ToggleFrameCounter; + SCustomKey ToggleFPS; + SCustomKey ToggleInput; SCustomKey ToggleLag; SCustomKey LastItem; // dummy, must be last diff --git a/desmume/src/windows/main.h b/desmume/src/windows/main.h index df973d5f9..bce93b7f8 100644 --- a/desmume/src/windows/main.h +++ b/desmume/src/windows/main.h @@ -13,6 +13,10 @@ void Display(); void Pause(); void FrameAdvance(); extern bool ShowInputDisplay; + +extern bool frameCounterDisplay; +extern bool FpsDisplay; +extern bool ShowInputDisplay; extern bool ShowLagFrameCounter; #define GPU3D_NULL 0