|
|
|
@ -932,9 +932,6 @@ void CFrame::OnGameListCtrlItemActivated(wxListEvent& WXUNUSED(event))
|
|
|
|
|
|
|
|
|
|
static bool IsHotkey(wxKeyEvent &event, int id, bool held = false)
|
|
|
|
|
{
|
|
|
|
|
if (Core::GetState() == Core::CORE_UNINITIALIZED)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
// Input event hotkey
|
|
|
|
|
if (event.GetKeyCode() == WXK_NONE)
|
|
|
|
|
{
|
|
|
|
@ -1084,9 +1081,16 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
|
|
|
|
|
{
|
|
|
|
|
if (Core::GetState() != Core::CORE_UNINITIALIZED &&
|
|
|
|
|
(RendererHasFocus() || TASInputHasFocus()))
|
|
|
|
|
{
|
|
|
|
|
if (IsHotkey(event, HK_TOGGLE_THROTTLE))
|
|
|
|
|
{
|
|
|
|
|
Core::SetIsFramelimiterTempDisabled(true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ParseHotkeys(event);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
event.Skip();
|
|
|
|
@ -1297,149 +1301,22 @@ void CFrame::PollHotkeys(wxTimerEvent& event)
|
|
|
|
|
{
|
|
|
|
|
HotkeyManagerEmu::GetStatus();
|
|
|
|
|
wxKeyEvent keyevent = 0;
|
|
|
|
|
|
|
|
|
|
if (IsHotkey(keyevent, HK_TOGGLE_THROTTLE))
|
|
|
|
|
{
|
|
|
|
|
Core::SetIsFramelimiterTempDisabled(false);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ParseHotkeys(keyevent);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFrame::ParseHotkeys(wxKeyEvent &event)
|
|
|
|
|
{
|
|
|
|
|
int WiimoteId = -1;
|
|
|
|
|
// Toggle fullscreen
|
|
|
|
|
if (IsHotkey(event, HK_FULLSCREEN))
|
|
|
|
|
DoFullscreen(!RendererIsFullscreen());
|
|
|
|
|
// Send Debugger keys to CodeWindow
|
|
|
|
|
else if (g_pCodeWindow && (event.GetKeyCode() >= WXK_F9 && event.GetKeyCode() <= WXK_F11))
|
|
|
|
|
event.Skip();
|
|
|
|
|
// Pause and Unpause
|
|
|
|
|
else if (IsHotkey(event, HK_PLAY_PAUSE))
|
|
|
|
|
DoPause();
|
|
|
|
|
// Stop
|
|
|
|
|
else if (IsHotkey(event, HK_STOP))
|
|
|
|
|
DoStop();
|
|
|
|
|
// Screenshot hotkey
|
|
|
|
|
else if (IsHotkey(event, HK_SCREENSHOT))
|
|
|
|
|
Core::SaveScreenShot();
|
|
|
|
|
else if (IsHotkey(event, HK_EXIT))
|
|
|
|
|
wxPostEvent(this, wxCommandEvent(wxID_EXIT));
|
|
|
|
|
else if (IsHotkey(event, HK_VOLUME_DOWN))
|
|
|
|
|
AudioCommon::DecreaseVolume(3);
|
|
|
|
|
else if (IsHotkey(event, HK_VOLUME_UP))
|
|
|
|
|
AudioCommon::IncreaseVolume(3);
|
|
|
|
|
else if (IsHotkey(event, HK_VOLUME_TOGGLE_MUTE))
|
|
|
|
|
AudioCommon::ToggleMuteVolume();
|
|
|
|
|
// Wiimote connect and disconnect hotkeys
|
|
|
|
|
else if (IsHotkey(event, HK_WIIMOTE1_CONNECT))
|
|
|
|
|
WiimoteId = 0;
|
|
|
|
|
else if (IsHotkey(event, HK_WIIMOTE2_CONNECT))
|
|
|
|
|
WiimoteId = 1;
|
|
|
|
|
else if (IsHotkey(event, HK_WIIMOTE3_CONNECT))
|
|
|
|
|
WiimoteId = 2;
|
|
|
|
|
else if (IsHotkey(event, HK_WIIMOTE4_CONNECT))
|
|
|
|
|
WiimoteId = 3;
|
|
|
|
|
else if (IsHotkey(event, HK_BALANCEBOARD_CONNECT))
|
|
|
|
|
WiimoteId = 4;
|
|
|
|
|
else if (IsHotkey(event, HK_TOGGLE_IR))
|
|
|
|
|
if (IsHotkey(event, HK_TOGGLE_THROTTLE, false))
|
|
|
|
|
{
|
|
|
|
|
OSDChoice = 1;
|
|
|
|
|
// Toggle native resolution
|
|
|
|
|
if (++g_Config.iEFBScale > SCALE_4X)
|
|
|
|
|
g_Config.iEFBScale = SCALE_AUTO;
|
|
|
|
|
}
|
|
|
|
|
else if (IsHotkey(event, HK_INCREASE_IR))
|
|
|
|
|
{
|
|
|
|
|
OSDChoice = 1;
|
|
|
|
|
if (++g_Config.iEFBScale > SCALE_4X)
|
|
|
|
|
g_Config.iEFBScale = SCALE_4X;
|
|
|
|
|
}
|
|
|
|
|
else if (IsHotkey(event, HK_DECREASE_IR))
|
|
|
|
|
{
|
|
|
|
|
OSDChoice = 1;
|
|
|
|
|
if (--g_Config.iEFBScale < SCALE_1X)
|
|
|
|
|
g_Config.iEFBScale = SCALE_1X;
|
|
|
|
|
}
|
|
|
|
|
else if (IsHotkey(event, HK_TOGGLE_AR))
|
|
|
|
|
{
|
|
|
|
|
OSDChoice = 2;
|
|
|
|
|
// Toggle aspect ratio
|
|
|
|
|
g_Config.iAspectRatio = (g_Config.iAspectRatio + 1) & 3;
|
|
|
|
|
}
|
|
|
|
|
else if (IsHotkey(event, HK_TOGGLE_EFBCOPIES))
|
|
|
|
|
{
|
|
|
|
|
OSDChoice = 3;
|
|
|
|
|
// Toggle EFB copies between EFB2RAM and EFB2Texture
|
|
|
|
|
g_Config.bSkipEFBCopyToRam = !g_Config.bSkipEFBCopyToRam;
|
|
|
|
|
}
|
|
|
|
|
else if (IsHotkey(event, HK_TOGGLE_FOG))
|
|
|
|
|
{
|
|
|
|
|
OSDChoice = 4;
|
|
|
|
|
g_Config.bDisableFog = !g_Config.bDisableFog;
|
|
|
|
|
Core::SetIsFramelimiterTempDisabled(false);
|
|
|
|
|
}
|
|
|
|
|
else if (IsHotkey(event, HK_TOGGLE_THROTTLE, true))
|
|
|
|
|
{
|
|
|
|
|
Core::SetIsFramelimiterTempDisabled(true);
|
|
|
|
|
}
|
|
|
|
|
else if (IsHotkey(event, HK_DECREASE_FRAME_LIMIT))
|
|
|
|
|
{
|
|
|
|
|
if (--SConfig::GetInstance().m_Framelimit > 0x19)
|
|
|
|
|
SConfig::GetInstance().m_Framelimit = 0x19;
|
|
|
|
|
}
|
|
|
|
|
else if (IsHotkey(event, HK_INCREASE_FRAME_LIMIT))
|
|
|
|
|
{
|
|
|
|
|
if (++SConfig::GetInstance().m_Framelimit > 0x19)
|
|
|
|
|
SConfig::GetInstance().m_Framelimit = 0;
|
|
|
|
|
}
|
|
|
|
|
else if (IsHotkey(event, HK_SAVE_STATE_SLOT_SELECTED))
|
|
|
|
|
{
|
|
|
|
|
State::Save(g_saveSlot);
|
|
|
|
|
}
|
|
|
|
|
else if (IsHotkey(event, HK_LOAD_STATE_SLOT_SELECTED))
|
|
|
|
|
{
|
|
|
|
|
State::Load(g_saveSlot);
|
|
|
|
|
}
|
|
|
|
|
else if (IsHotkey(event, HK_DECREASE_DEPTH, true))
|
|
|
|
|
{
|
|
|
|
|
if (--g_Config.iStereoDepth < 0)
|
|
|
|
|
g_Config.iStereoDepth = 0;
|
|
|
|
|
}
|
|
|
|
|
else if (IsHotkey(event, HK_INCREASE_DEPTH, true))
|
|
|
|
|
{
|
|
|
|
|
if (++g_Config.iStereoDepth > 100)
|
|
|
|
|
g_Config.iStereoDepth = 100;
|
|
|
|
|
}
|
|
|
|
|
else if (IsHotkey(event, HK_DECREASE_CONVERGENCE, true))
|
|
|
|
|
{
|
|
|
|
|
g_Config.iStereoConvergence -= 5;
|
|
|
|
|
if (g_Config.iStereoConvergence < 0)
|
|
|
|
|
g_Config.iStereoConvergence = 0;
|
|
|
|
|
}
|
|
|
|
|
else if (IsHotkey(event, HK_INCREASE_CONVERGENCE, true))
|
|
|
|
|
{
|
|
|
|
|
g_Config.iStereoConvergence += 5;
|
|
|
|
|
if (g_Config.iStereoConvergence > 500)
|
|
|
|
|
g_Config.iStereoConvergence = 500;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
for (int i = HK_SELECT_STATE_SLOT_1; i < HK_SELECT_STATE_SLOT_10; ++i)
|
|
|
|
|
{
|
|
|
|
|
if (IsHotkey(event, i))
|
|
|
|
|
{
|
|
|
|
|
wxCommandEvent slot_event;
|
|
|
|
|
slot_event.SetId(i + IDM_SELECT_SLOT_1 - HK_SELECT_STATE_SLOT_1);
|
|
|
|
|
CFrame::OnSelectSlot(slot_event);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unsigned int i = NUM_HOTKEYS;
|
|
|
|
|
unsigned int i = 0;
|
|
|
|
|
for (i = 0; i < NUM_HOTKEYS; i++)
|
|
|
|
|
{
|
|
|
|
|
bool held = false;
|
|
|
|
@ -1474,11 +1351,132 @@ void CFrame::ParseHotkeys(wxKeyEvent &event)
|
|
|
|
|
if (i == NUM_HOTKEYS)
|
|
|
|
|
event.Skip();
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if (Core::GetState() == Core::CORE_UNINITIALIZED)
|
|
|
|
|
{
|
|
|
|
|
event.Skip();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int WiimoteId = -1;
|
|
|
|
|
// Toggle fullscreen
|
|
|
|
|
if (IsHotkey(event, HK_FULLSCREEN))
|
|
|
|
|
DoFullscreen(!RendererIsFullscreen());
|
|
|
|
|
// Pause and Unpause
|
|
|
|
|
if (IsHotkey(event, HK_PLAY_PAUSE))
|
|
|
|
|
DoPause();
|
|
|
|
|
// Stop
|
|
|
|
|
if (IsHotkey(event, HK_STOP))
|
|
|
|
|
DoStop();
|
|
|
|
|
// Screenshot hotkey
|
|
|
|
|
if (IsHotkey(event, HK_SCREENSHOT))
|
|
|
|
|
Core::SaveScreenShot();
|
|
|
|
|
if (IsHotkey(event, HK_EXIT))
|
|
|
|
|
wxPostEvent(this, wxCommandEvent(wxID_EXIT));
|
|
|
|
|
if (IsHotkey(event, HK_VOLUME_DOWN))
|
|
|
|
|
AudioCommon::DecreaseVolume(3);
|
|
|
|
|
if (IsHotkey(event, HK_VOLUME_UP))
|
|
|
|
|
AudioCommon::IncreaseVolume(3);
|
|
|
|
|
if (IsHotkey(event, HK_VOLUME_TOGGLE_MUTE))
|
|
|
|
|
AudioCommon::ToggleMuteVolume();
|
|
|
|
|
// Wiimote connect and disconnect hotkeys
|
|
|
|
|
if (IsHotkey(event, HK_WIIMOTE1_CONNECT))
|
|
|
|
|
WiimoteId = 0;
|
|
|
|
|
if (IsHotkey(event, HK_WIIMOTE2_CONNECT))
|
|
|
|
|
WiimoteId = 1;
|
|
|
|
|
if (IsHotkey(event, HK_WIIMOTE3_CONNECT))
|
|
|
|
|
WiimoteId = 2;
|
|
|
|
|
if (IsHotkey(event, HK_WIIMOTE4_CONNECT))
|
|
|
|
|
WiimoteId = 3;
|
|
|
|
|
if (IsHotkey(event, HK_BALANCEBOARD_CONNECT))
|
|
|
|
|
WiimoteId = 4;
|
|
|
|
|
if (IsHotkey(event, HK_TOGGLE_IR))
|
|
|
|
|
{
|
|
|
|
|
OSDChoice = 1;
|
|
|
|
|
// Toggle native resolution
|
|
|
|
|
if (++g_Config.iEFBScale > SCALE_4X)
|
|
|
|
|
g_Config.iEFBScale = SCALE_AUTO;
|
|
|
|
|
}
|
|
|
|
|
if (IsHotkey(event, HK_INCREASE_IR))
|
|
|
|
|
{
|
|
|
|
|
OSDChoice = 1;
|
|
|
|
|
++g_Config.iEFBScale;
|
|
|
|
|
}
|
|
|
|
|
if (IsHotkey(event, HK_DECREASE_IR))
|
|
|
|
|
{
|
|
|
|
|
OSDChoice = 1;
|
|
|
|
|
if (--g_Config.iEFBScale < SCALE_1X)
|
|
|
|
|
g_Config.iEFBScale = SCALE_1X;
|
|
|
|
|
}
|
|
|
|
|
if (IsHotkey(event, HK_TOGGLE_AR))
|
|
|
|
|
{
|
|
|
|
|
OSDChoice = 2;
|
|
|
|
|
// Toggle aspect ratio
|
|
|
|
|
g_Config.iAspectRatio = (g_Config.iAspectRatio + 1) & 3;
|
|
|
|
|
}
|
|
|
|
|
if (IsHotkey(event, HK_TOGGLE_EFBCOPIES))
|
|
|
|
|
{
|
|
|
|
|
OSDChoice = 3;
|
|
|
|
|
// Toggle EFB copies between EFB2RAM and EFB2Texture
|
|
|
|
|
g_Config.bSkipEFBCopyToRam = !g_Config.bSkipEFBCopyToRam;
|
|
|
|
|
}
|
|
|
|
|
if (IsHotkey(event, HK_TOGGLE_FOG))
|
|
|
|
|
{
|
|
|
|
|
OSDChoice = 4;
|
|
|
|
|
g_Config.bDisableFog = !g_Config.bDisableFog;
|
|
|
|
|
}
|
|
|
|
|
if (IsHotkey(event, HK_DECREASE_FRAME_LIMIT))
|
|
|
|
|
{
|
|
|
|
|
if (--SConfig::GetInstance().m_Framelimit > 0x19)
|
|
|
|
|
SConfig::GetInstance().m_Framelimit = 0x19;
|
|
|
|
|
}
|
|
|
|
|
if (IsHotkey(event, HK_INCREASE_FRAME_LIMIT))
|
|
|
|
|
{
|
|
|
|
|
if (++SConfig::GetInstance().m_Framelimit > 0x19)
|
|
|
|
|
SConfig::GetInstance().m_Framelimit = 0;
|
|
|
|
|
}
|
|
|
|
|
if (IsHotkey(event, HK_SAVE_STATE_SLOT_SELECTED))
|
|
|
|
|
{
|
|
|
|
|
State::Save(g_saveSlot);
|
|
|
|
|
}
|
|
|
|
|
if (IsHotkey(event, HK_LOAD_STATE_SLOT_SELECTED))
|
|
|
|
|
{
|
|
|
|
|
State::Load(g_saveSlot);
|
|
|
|
|
}
|
|
|
|
|
if (IsHotkey(event, HK_DECREASE_DEPTH, true))
|
|
|
|
|
{
|
|
|
|
|
if (--g_Config.iStereoDepth < 0)
|
|
|
|
|
g_Config.iStereoDepth = 0;
|
|
|
|
|
}
|
|
|
|
|
if (IsHotkey(event, HK_INCREASE_DEPTH, true))
|
|
|
|
|
{
|
|
|
|
|
if (++g_Config.iStereoDepth > 100)
|
|
|
|
|
g_Config.iStereoDepth = 100;
|
|
|
|
|
}
|
|
|
|
|
if (IsHotkey(event, HK_DECREASE_CONVERGENCE, true))
|
|
|
|
|
{
|
|
|
|
|
g_Config.iStereoConvergence -= 5;
|
|
|
|
|
if (g_Config.iStereoConvergence < 0)
|
|
|
|
|
g_Config.iStereoConvergence = 0;
|
|
|
|
|
}
|
|
|
|
|
if (IsHotkey(event, HK_INCREASE_CONVERGENCE, true))
|
|
|
|
|
{
|
|
|
|
|
g_Config.iStereoConvergence += 5;
|
|
|
|
|
if (g_Config.iStereoConvergence > 500)
|
|
|
|
|
g_Config.iStereoConvergence = 500;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = HK_SELECT_STATE_SLOT_1; i < HK_SELECT_STATE_SLOT_10; ++i)
|
|
|
|
|
{
|
|
|
|
|
if (IsHotkey(event, i))
|
|
|
|
|
{
|
|
|
|
|
wxCommandEvent slot_event;
|
|
|
|
|
slot_event.SetId(i + IDM_SELECT_SLOT_1 - HK_SELECT_STATE_SLOT_1);
|
|
|
|
|
CFrame::OnSelectSlot(slot_event);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Actually perform the Wiimote connection or disconnection
|
|
|
|
|
if (Core::GetState() != Core::CORE_UNINITIALIZED)
|
|
|
|
|
{
|
|
|
|
|
if (WiimoteId >= 0 && SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
|
|
|
|
|
{
|
|
|
|
|
wxCommandEvent evt;
|
|
|
|
@ -1487,26 +1485,24 @@ void CFrame::ParseHotkeys(wxKeyEvent &event)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static float debugSpeed = 1.0f;
|
|
|
|
|
|
|
|
|
|
if (IsHotkey(event, HK_FREELOOK_DECREASE_SPEED, true))
|
|
|
|
|
debugSpeed /= 1.1f;
|
|
|
|
|
else if (IsHotkey(event, HK_FREELOOK_INCREASE_SPEED, true))
|
|
|
|
|
if (IsHotkey(event, HK_FREELOOK_INCREASE_SPEED, true))
|
|
|
|
|
debugSpeed *= 1.1f;
|
|
|
|
|
else if (IsHotkey(event, HK_FREELOOK_RESET_SPEED, true))
|
|
|
|
|
if (IsHotkey(event, HK_FREELOOK_RESET_SPEED, true))
|
|
|
|
|
debugSpeed = 1.0f;
|
|
|
|
|
else if (IsHotkey(event, HK_FREELOOK_UP, true))
|
|
|
|
|
if (IsHotkey(event, HK_FREELOOK_UP, true))
|
|
|
|
|
VertexShaderManager::TranslateView(0.0f, 0.0f, -debugSpeed);
|
|
|
|
|
else if (IsHotkey(event, HK_FREELOOK_DOWN, true))
|
|
|
|
|
if (IsHotkey(event, HK_FREELOOK_DOWN, true))
|
|
|
|
|
VertexShaderManager::TranslateView(0.0f, 0.0f, debugSpeed);
|
|
|
|
|
else if (IsHotkey(event, HK_FREELOOK_LEFT, true))
|
|
|
|
|
if (IsHotkey(event, HK_FREELOOK_LEFT, true))
|
|
|
|
|
VertexShaderManager::TranslateView(debugSpeed, 0.0f);
|
|
|
|
|
else if (IsHotkey(event, HK_FREELOOK_RIGHT, true))
|
|
|
|
|
if (IsHotkey(event, HK_FREELOOK_RIGHT, true))
|
|
|
|
|
VertexShaderManager::TranslateView(-debugSpeed, 0.0f);
|
|
|
|
|
else if (IsHotkey(event, HK_FREELOOK_ZOOM_IN, true))
|
|
|
|
|
if (IsHotkey(event, HK_FREELOOK_ZOOM_IN, true))
|
|
|
|
|
VertexShaderManager::TranslateView(0.0f, debugSpeed);
|
|
|
|
|
else if (IsHotkey(event, HK_FREELOOK_ZOOM_OUT, true))
|
|
|
|
|
if (IsHotkey(event, HK_FREELOOK_ZOOM_OUT, true))
|
|
|
|
|
VertexShaderManager::TranslateView(0.0f, -debugSpeed);
|
|
|
|
|
else if (IsHotkey(event, HK_FREELOOK_RESET, true))
|
|
|
|
|
if (IsHotkey(event, HK_FREELOOK_RESET, true))
|
|
|
|
|
VertexShaderManager::ResetView();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|