mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
Added hotkey Alt+F1/F2/F3/F4 for connect/disconnect wiimote with OSD display
(But there is still a little problem with DX9 fullscreen toggling) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4782 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -160,12 +160,17 @@ CPanel::CPanel(
|
||||
return 0;
|
||||
|
||||
case WIIMOTE_DISCONNECT:
|
||||
// The Wiimote has been disconnect, we offer reconnect here
|
||||
if(AskYesNo("Wiimote %i has been disconnected by system.\n"
|
||||
"Maybe this game doesn't support multi-wiimote,\n"
|
||||
"or maybe it is due to idle time out or other reason.\n\n"
|
||||
"Do you want to reconnect immediately?", lParam + 1, "Confirm", wxYES_NO))
|
||||
GetUsbPointer()->AccessWiiMote(lParam | 0x100)->Activate(true);
|
||||
if (main_frame->bNoWiimoteMsg)
|
||||
main_frame->bNoWiimoteMsg = false;
|
||||
else
|
||||
{
|
||||
// The Wiimote has been disconnect, we offer reconnect here
|
||||
if(AskYesNo("Wiimote %i has been disconnected by system.\n"
|
||||
"Maybe this game doesn't support multi-wiimote,\n"
|
||||
"or maybe it is due to idle time out or other reason.\n\n"
|
||||
"Do you want to reconnect immediately?", lParam + 1, "Confirm", wxYES_NO))
|
||||
GetUsbPointer()->AccessWiiMote(lParam | 0x100)->Activate(true);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
@ -314,13 +319,12 @@ CFrame::CFrame(wxFrame* parent,
|
||||
, bRenderToMain(false), bFloatLogWindow(false), bFloatConsoleWindow(false)
|
||||
, HaveLeds(false), HaveSpeakers(false)
|
||||
, m_fLastClickTime(0), m_iLastMotionTime(0), LastMouseX(0), LastMouseY(0)
|
||||
, m_bControlsCreated(false), bNoWiimoteMsg(false)
|
||||
#if wxUSE_TIMER
|
||||
, m_timer(this)
|
||||
#endif
|
||||
|
||||
{
|
||||
m_bControlsCreated = false;
|
||||
|
||||
if (ShowLogWindow) SConfig::GetInstance().m_InterfaceLogWindow = true;
|
||||
|
||||
// Give it a console early to show potential messages from this onward
|
||||
|
@ -76,6 +76,7 @@ class CFrame : public wxFrame
|
||||
void InitBitmaps();
|
||||
void DoStop();
|
||||
bool bRenderToMain;
|
||||
bool bNoWiimoteMsg;
|
||||
void UpdateGUI();
|
||||
void ToggleLogWindow(bool, int i = -1);
|
||||
void ToggleConsole(bool, int i = -1);
|
||||
|
@ -199,10 +199,10 @@ void CFrame::CreateMenu()
|
||||
toolsMenu->Append(IDM_LOAD_WII_MENU, _T("Load Wii Menu"));
|
||||
}
|
||||
toolsMenu->AppendSeparator();
|
||||
toolsMenu->AppendCheckItem(IDM_CONNECT_WIIMOTE1, _T("Connect Wiimote 1"));
|
||||
toolsMenu->AppendCheckItem(IDM_CONNECT_WIIMOTE2, _T("Connect Wiimote 2"));
|
||||
toolsMenu->AppendCheckItem(IDM_CONNECT_WIIMOTE3, _T("Connect Wiimote 3"));
|
||||
toolsMenu->AppendCheckItem(IDM_CONNECT_WIIMOTE4, _T("Connect Wiimote 4"));
|
||||
toolsMenu->AppendCheckItem(IDM_CONNECT_WIIMOTE1, _T("Connect Wiimote 1\tAlt+F1"));
|
||||
toolsMenu->AppendCheckItem(IDM_CONNECT_WIIMOTE2, _T("Connect Wiimote 2\tAlt+F2"));
|
||||
toolsMenu->AppendCheckItem(IDM_CONNECT_WIIMOTE3, _T("Connect Wiimote 3\tAlt+F3"));
|
||||
toolsMenu->AppendCheckItem(IDM_CONNECT_WIIMOTE4, _T("Connect Wiimote 4\tAlt+F4"));
|
||||
|
||||
m_MenuBar->Append(toolsMenu, _T("&Tools"));
|
||||
|
||||
@ -808,7 +808,10 @@ void CFrame::OnConnectWiimote(wxCommandEvent& event)
|
||||
if (Core::isRunning() && Core::GetStartupParameter().bWii)
|
||||
{
|
||||
int Id = event.GetId() - IDM_CONNECT_WIIMOTE1;
|
||||
bNoWiimoteMsg = !event.IsChecked();
|
||||
GetUsbPointer()->AccessWiiMote(Id | 0x100)->Activate(event.IsChecked());
|
||||
wxString msg(wxString::Format(wxT("Wiimote %i %s"), Id + 1, (event.IsChecked()) ? wxT("Connected") : wxT("Disconnected")));
|
||||
Core::DisplayMessage(msg.ToAscii(), 3000);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user