Add shortcut to (dis)connect the balance board.

Fixes issue 6383.
This commit is contained in:
Rachel Bryk 2013-06-26 06:23:29 -04:00
parent 06d721984d
commit 63a747edc0
6 changed files with 17 additions and 3 deletions

View File

@ -41,6 +41,7 @@ static const struct {
{ "Wiimote2Connect", 50 /* '2' */, 2 /* wxMOD_CMD */ },
{ "Wiimote3Connect", 51 /* '3' */, 2 /* wxMOD_CMD */ },
{ "Wiimote4Connect", 52 /* '4' */, 2 /* wxMOD_CMD */ },
{ "BalanceBoardConnect",53 /* '4' */, 2 /* wxMOD_CMD */ },
#else
{ "Open", 79 /* 'O' */, 2 /* wxMOD_CONTROL */},
{ "ChangeDisc", 0, 0 /* wxMOD_NONE */ },
@ -64,6 +65,7 @@ static const struct {
{ "Wiimote2Connect", 345 /* WXK_F6 */, 1 /* wxMOD_ALT */ },
{ "Wiimote3Connect", 346 /* WXK_F7 */, 1 /* wxMOD_ALT */ },
{ "Wiimote4Connect", 347 /* WXK_F8 */, 1 /* wxMOD_ALT */ },
{ "BalanceBoardConnect",348 /* WXK_F9 */, 1 /* wxMOD_ALT */ },
#endif
{ "LoadStateSlot1", 340 /* WXK_F1 */, 0 /* wxMOD_NONE */ },

View File

@ -32,6 +32,7 @@ enum Hotkey
HK_WIIMOTE2_CONNECT,
HK_WIIMOTE3_CONNECT,
HK_WIIMOTE4_CONNECT,
HK_BALANCEBOARD_CONNECT,
HK_LOAD_STATE_SLOT_1,
HK_LOAD_STATE_SLOT_2,

View File

@ -215,7 +215,7 @@ EVT_MENU_RANGE(IDM_LOADLAST1, IDM_LOADLAST8, CFrame::OnLoadLastState)
EVT_MENU_RANGE(IDM_SAVESLOT1, IDM_SAVESLOT8, CFrame::OnSaveState)
EVT_MENU_RANGE(IDM_FRAMESKIP0, IDM_FRAMESKIP9, CFrame::OnFrameSkip)
EVT_MENU_RANGE(IDM_DRIVE1, IDM_DRIVE24, CFrame::OnBootDrive)
EVT_MENU_RANGE(IDM_CONNECT_WIIMOTE1, IDM_CONNECT_WIIMOTE4, CFrame::OnConnectWiimote)
EVT_MENU_RANGE(IDM_CONNECT_WIIMOTE1, IDM_CONNECT_BALANCEBOARD, CFrame::OnConnectWiimote)
EVT_MENU_RANGE(IDM_LISTWAD, IDM_LISTDRIVES, CFrame::GameListChanged)
// Other
@ -739,6 +739,7 @@ int GetCmdForHotkey(unsigned int key)
case HK_WIIMOTE2_CONNECT: return IDM_CONNECT_WIIMOTE2;
case HK_WIIMOTE3_CONNECT: return IDM_CONNECT_WIIMOTE3;
case HK_WIIMOTE4_CONNECT: return IDM_CONNECT_WIIMOTE4;
case HK_BALANCEBOARD_CONNECT: return IDM_CONNECT_BALANCEBOARD;
case HK_LOAD_STATE_SLOT_1: return IDM_LOADSLOT1;
case HK_LOAD_STATE_SLOT_2: return IDM_LOADSLOT2;
@ -823,6 +824,8 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
WiimoteId = 2;
else if (IsHotkey(event, HK_WIIMOTE4_CONNECT))
WiimoteId = 3;
else if (IsHotkey(event, HK_BALANCEBOARD_CONNECT))
WiimoteId = 4;
else
{
unsigned int i = NUM_HOTKEYS;

View File

@ -205,6 +205,7 @@ void CFrame::CreateMenu()
toolsMenu->AppendCheckItem(IDM_CONNECT_WIIMOTE2, GetMenuLabel(HK_WIIMOTE2_CONNECT));
toolsMenu->AppendCheckItem(IDM_CONNECT_WIIMOTE3, GetMenuLabel(HK_WIIMOTE3_CONNECT));
toolsMenu->AppendCheckItem(IDM_CONNECT_WIIMOTE4, GetMenuLabel(HK_WIIMOTE4_CONNECT));
toolsMenu->AppendCheckItem(IDM_CONNECT_BALANCEBOARD, GetMenuLabel(HK_BALANCEBOARD_CONNECT));
m_MenuBar->Append(toolsMenu, _("&Tools"));
@ -370,7 +371,9 @@ wxString CFrame::GetMenuLabel(int Id)
Label = wxString::Format(_("Connect Wiimote %i"),
Id - HK_WIIMOTE1_CONNECT + 1);
break;
case HK_BALANCEBOARD_CONNECT:
Label = _("Connect Balance Board");
break;
case HK_LOAD_STATE_SLOT_1:
case HK_LOAD_STATE_SLOT_2:
case HK_LOAD_STATE_SLOT_3:
@ -1570,13 +1573,14 @@ void CFrame::UpdateGUI()
if (DiscIO::CNANDContentManager::Access().GetNANDLoader(TITLEID_SYSMENU).IsValid())
GetMenuBar()->FindItem(IDM_LOAD_WII_MENU)->Enable(!Initialized);
// Tools
// Tools
GetMenuBar()->FindItem(IDM_CHEATS)->Enable(SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats);
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE1)->Enable(RunningWii);
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE2)->Enable(RunningWii);
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE3)->Enable(RunningWii);
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE4)->Enable(RunningWii);
GetMenuBar()->FindItem(IDM_CONNECT_BALANCEBOARD)->Enable(RunningWii);
GetMenuBar()->FindItem(IDM_CONFIG_WIIMOTE_PLUGIN)->Enable(!RunningGamecube);
if (RunningWii)
{
@ -1588,6 +1592,8 @@ void CFrame::UpdateGUI()
AccessWiiMote(0x0102)->IsConnected());
GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE4)->Check(GetUsbPointer()->
AccessWiiMote(0x0103)->IsConnected());
GetMenuBar()->FindItem(IDM_CONNECT_BALANCEBOARD)->Check(GetUsbPointer()->
AccessWiiMote(0x0104)->IsConnected());
}
if (Running)

View File

@ -97,6 +97,7 @@ enum
IDM_CONNECT_WIIMOTE2,
IDM_CONNECT_WIIMOTE3,
IDM_CONNECT_WIIMOTE4,
IDM_CONNECT_BALANCEBOARD,
IDM_LISTWAD,
IDM_LISTWII,

View File

@ -185,6 +185,7 @@ void HotkeyConfigDialog::CreateHotkeyGUIControls(void)
_("Connect Wiimote 2"),
_("Connect Wiimote 3"),
_("Connect Wiimote 4"),
_("Connect Balance Board"),
_("Load State Slot 1"),
_("Load State Slot 2"),