From 97789af476ca26569e6521c5adeca5d3eb63c569 Mon Sep 17 00:00:00 2001 From: adelikat Date: Mon, 13 Apr 2009 04:56:51 +0000 Subject: [PATCH] Added Open ROM Hotkey, Removed Ctrl+O accel key. --- desmume/src/windows/hotkey.cpp | 11 ++++++++++- desmume/src/windows/hotkey.h | 2 +- desmume/src/windows/main.cpp | 1 - desmume/src/windows/resource.h | 1 - desmume/src/windows/resources.rc | 1 - 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/desmume/src/windows/hotkey.cpp b/desmume/src/windows/hotkey.cpp index b59f0be4b..4d823deb6 100644 --- a/desmume/src/windows/hotkey.cpp +++ b/desmume/src/windows/hotkey.cpp @@ -28,6 +28,8 @@ #include "throttle.h" #include "../mic.h" +extern LRESULT OpenFile(); //adelikat: Made this an extern here instead of main.h Seemed icky not to limit the scope of this function + SCustomKeys CustomKeys; bool AutoHoldPressed=false; @@ -68,7 +70,7 @@ void CopyCustomKeys (SCustomKeys *dst, const SCustomKeys *src) //====================================================================================== //=====================================HANDLERS========================================= //====================================================================================== - +void HK_OpenROM(int) {OpenFile();} void HK_PrintScreen(int param) { OPENFILENAME ofn; @@ -239,6 +241,13 @@ void InitCustomKeys (SCustomKeys *keys) }; //Main Page--------------------------------------- + keys->OpenROM.handleKeyDown = HK_OpenROM; + keys->OpenROM.code = "OpenROM"; + keys->OpenROM.name = L"Open ROM"; + keys->OpenROM.page = HOTKEY_PAGE_MAIN; + keys->OpenROM.key = 'O'; + keys->OpenROM.modifiers = CUSTKEY_CTRL_MASK; + keys->Reset.handleKeyDown = HK_Reset; keys->Reset.code = "Reset"; keys->Reset.name = L"Reset"; diff --git a/desmume/src/windows/hotkey.h b/desmume/src/windows/hotkey.h index 70ad96d31..397cef441 100644 --- a/desmume/src/windows/hotkey.h +++ b/desmume/src/windows/hotkey.h @@ -65,7 +65,7 @@ struct SCustomKeys SCustomKey Slot[10]; SCustomKey QuickSave, QuickLoad; - SCustomKey Reset, Pause, FrameAdvance, FastForward, FastForwardToggle, IncreaseSpeed, DecreaseSpeed, Microphone; + SCustomKey OpenROM, Reset, Pause, FrameAdvance, FastForward, FastForwardToggle, IncreaseSpeed, DecreaseSpeed, Microphone; SCustomKey TurboRight, TurboLeft, TurboDown, TurboUp, TurboSelect, TurboStart, TurboB, TurboA, TurboY, TurboX; diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index a40a984fc..24d08af92 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -2548,7 +2548,6 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM case IDM_QUIT: DestroyWindow(hwnd); return 0; - case ACCEL_CTRL_O: case IDM_OPEN: return OpenFile(); case IDM_PRINTSCREEN: diff --git a/desmume/src/windows/resource.h b/desmume/src/windows/resource.h index 1efb2c96a..5f26d4430 100644 --- a/desmume/src/windows/resource.h +++ b/desmume/src/windows/resource.h @@ -426,7 +426,6 @@ #define ID_VIEW_DISPLAYMICROPHONE 40014 #define IDM_FILE_RECORDAVI 40015 #define IDM_FILE_STOPAVI 40016 -#define ACCEL_CTRL_O 40032 #define ID_FILE_RECENTROM 40034 #define IDC_SAVETYPE7 40037 #define IDM_DEFSIZE 40038 diff --git a/desmume/src/windows/resources.rc b/desmume/src/windows/resources.rc index 7060e8f12..fc91c3a95 100644 --- a/desmume/src/windows/resources.rc +++ b/desmume/src/windows/resources.rc @@ -2445,5 +2445,4 @@ FONT 8, "Ms Shell Dlg" LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDR_MAIN_ACCEL ACCELERATORS { - "O", ACCEL_CTRL_O, VIRTKEY, CONTROL }