From 35b6d80a6202463f05fc51cd787d477b8b29ca55 Mon Sep 17 00:00:00 2001 From: hi-coder Date: Mon, 15 Oct 2012 06:28:21 +0000 Subject: [PATCH] add hot key to toggle cursor on and off win - english --- desmume/src/windows/hotkey.cpp | 16 ++++++++++++++++ desmume/src/windows/hotkey.h | 2 ++ desmume/src/windows/resource.h | 1 + desmume/src/windows/resources.rc | Bin 1421358 -> 1421442 bytes 4 files changed, 19 insertions(+) diff --git a/desmume/src/windows/hotkey.cpp b/desmume/src/windows/hotkey.cpp index de415003f..cdbfee024 100644 --- a/desmume/src/windows/hotkey.cpp +++ b/desmume/src/windows/hotkey.cpp @@ -480,6 +480,16 @@ void HK_Rotate90(int, bool justPressed) { SetRotate(MainWindow->getHWnd(), 90);} void HK_Rotate180(int, bool justPressed) { SetRotate(MainWindow->getHWnd(), 180);} void HK_Rotate270(int, bool justPressed) { SetRotate(MainWindow->getHWnd(), 270);} + +void HK_CursorToggle(int, bool) +{ + static int cursorVisible = ShowCursor(TRUE); + if(cursorVisible >= 0) + while( (cursorVisible = ShowCursor(FALSE)) >= 0); + else + while( (cursorVisible = ShowCursor(TRUE)) <= 0); +} + //====================================================================================== //=====================================DEFINITIONS====================================== //====================================================================================== @@ -875,6 +885,12 @@ void InitCustomKeys (SCustomKeys *keys) keys->Rotate270.page = HOTKEY_PAGE_OTHER; keys->Rotate270.key = NULL; + keys->CursorToggle.handleKeyDown = HK_CursorToggle; + keys->CursorToggle.code = "Toggle Cursor"; + keys->CursorToggle.name = STRW(ID_LABEL_HK62); + keys->CursorToggle.page = HOTKEY_PAGE_OTHER; + keys->CursorToggle.key = NULL; + //StateSlots Page -------------------------------------------------- keys->NextSaveSlot.handleKeyDown = HK_NextSaveSlot; keys->NextSaveSlot.code = "NextSaveSlot"; diff --git a/desmume/src/windows/hotkey.h b/desmume/src/windows/hotkey.h index 398c288a7..3bfd4c147 100644 --- a/desmume/src/windows/hotkey.h +++ b/desmume/src/windows/hotkey.h @@ -72,6 +72,8 @@ struct SCustomKeys SCustomKey Rotate0, Rotate90, Rotate180, Rotate270; + SCustomKey CursorToggle; + SCustomKey OpenROM, ReloadROM, Reset, Pause; #ifdef HAVE_JIT diff --git a/desmume/src/windows/resource.h b/desmume/src/windows/resource.h index 0f22df284..9c60f299a 100644 --- a/desmume/src/windows/resource.h +++ b/desmume/src/windows/resource.h @@ -808,6 +808,7 @@ #define ID_LABEL_HK59 4524 #define ID_LABEL_HK60 4525 #define ID_LABEL_HK61 4526 +#define ID_LABEL_HK62 4527 #define IDD_MICROPHONE 5000 #define IDM_MICROPHONESETTINGS 5001 #define IDC_MICSAMPLEBROWSE 5003 diff --git a/desmume/src/windows/resources.rc b/desmume/src/windows/resources.rc index e36975e586715fd44f58671059679a66240b2ed8..40a7d16b79f31e9b412c38759d7c049b4395268b 100644 GIT binary patch delta 120 zcmZ4YAgt+OSVIeA3sVbo3rh=Y3tJ0&3&$2t8&gKk>5VU#B&R#sbIMG=@PUbk+nJ%1 zp@^ZFA)ldW`a@05_~|hLLQ?JPOgVv=3y8Uam