Skip to content

Commit

Permalink
Dedup MainForm.CheckHotkey with existing helpers / event handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
YoshiRulz committed Jul 7, 2024
1 parent d515b1b commit c99d221
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/BizHawk.Client.EmuHawk/MainForm.Hotkey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void ToggleGambatteSyncSetting(
ToggleBackgroundInput();
break;
case "Toggle Menu":
MainMenuStrip.Visible ^= true;
ShowMenuContextMenuItem_Click(this, EventArgs.Empty);
break;
case "Volume Up":
VolumeUp();
Expand Down Expand Up @@ -158,15 +158,14 @@ void ToggleGambatteSyncSetting(
ToggleKeyPriority();
break;
case "Toggle Messages":
Config.DisplayMessages ^= true;
DisplayMessagesMenuItem_Click(this, EventArgs.Empty);
break;
case "Toggle Display Nothing":
// TODO: account for 1 when implemented
Config.DispSpeedupFeatures = Config.DispSpeedupFeatures == 0 ? 2 : 0;
break;
case "Accept Background Input":
Config.AcceptBackgroundInput ^= true;
AddOnScreenMessage($"Accept Background Input toggled {(Config.AcceptBackgroundInput ? "On" : "Off")}");
ToggleBackgroundInput();
break;

// Save States
Expand Down Expand Up @@ -296,16 +295,16 @@ void ToggleGambatteSyncSetting(

// Tools
case "RAM Watch":
Tools.LoadRamWatch(true);
RamWatchMenuItem_Click(this, EventArgs.Empty);
break;
case "RAM Search":
Tools.Load<RamSearch>();
RamSearchMenuItem_Click(this, EventArgs.Empty);
break;
case "Hex Editor":
Tools.Load<HexEditor>();
HexEditorMenuItem_Click(this, EventArgs.Empty);
break;
case "Trace Logger":
Tools.Load<TraceLogger>();
TraceLoggerMenuItem_Click(this, EventArgs.Empty);
break;
case "Lua Console":
OpenLuaConsole();
Expand All @@ -317,7 +316,7 @@ void ToggleGambatteSyncSetting(
}
break;
case "Cheats":
Tools.Load<Cheats>();
CheatsMenuItem_Click(this, EventArgs.Empty);
break;
case "Toggle All Cheats":
var cheats = CheatList.Where(static c => !c.IsSeparator).ToList();
Expand All @@ -335,10 +334,10 @@ void ToggleGambatteSyncSetting(
TAStudioMenuItem_Click(null, null);
break;
case "ToolBox":
Tools.Load<ToolBox>();
ToolBoxMenuItem_Click(this, EventArgs.Empty);
break;
case "Virtual Pad":
Tools.Load<VirtualpadTool>();
VirtualPadMenuItem_Click(this, EventArgs.Empty);
break;

// RAM Search
Expand Down

0 comments on commit c99d221

Please sign in to comment.