Changed "Wiimote On" to "Input Active", so you can bypass Wiimote input when you want to use GC controller instead, even though their buttons are binded to the same keys/pads.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4681 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
ayuanx 2009-12-11 13:57:25 +00:00
parent a751efcc6e
commit cca6f75110
8 changed files with 85 additions and 74 deletions

View File

@ -264,6 +264,7 @@ void Config::Load(bool ChangePad)
iniFile.Load(FULL_CONFIG_DIR "Wiimote.ini"); iniFile.Load(FULL_CONFIG_DIR "Wiimote.ini");
// General // General
iniFile.Get("Settings", "InputActive", &bInputActive, true);
iniFile.Get("Settings", "Sideways", &bSideways, false); iniFile.Get("Settings", "Sideways", &bSideways, false);
iniFile.Get("Settings", "Upright", &bUpright, false); iniFile.Get("Settings", "Upright", &bUpright, false);
iniFile.Get("Settings", "ExtensionConnected", &iExtensionConnected, EXT_NONE); iniFile.Get("Settings", "ExtensionConnected", &iExtensionConnected, EXT_NONE);
@ -370,6 +371,7 @@ void Config::Save(int Slot)
{ {
IniFile iniFile; IniFile iniFile;
iniFile.Load(FULL_CONFIG_DIR "Wiimote.ini"); iniFile.Load(FULL_CONFIG_DIR "Wiimote.ini");
iniFile.Set("Settings", "InputActive", bInputActive);
iniFile.Set("Settings", "Sideways", bSideways); iniFile.Set("Settings", "Sideways", bSideways);
iniFile.Set("Settings", "Upright", bUpright); iniFile.Set("Settings", "Upright", bUpright);
iniFile.Set("Settings", "MotionPlusConnected", bMotionPlusConnected); iniFile.Set("Settings", "MotionPlusConnected", bMotionPlusConnected);
@ -391,7 +393,6 @@ void Config::Save(int Slot)
char SectionName[32]; char SectionName[32];
sprintf(SectionName, "Wiimote%i", i + 1); sprintf(SectionName, "Wiimote%i", i + 1);
iniFile.Set(SectionName, "Enabled", WiiMoteEmu::PadMapping[i].enabled);
iniFile.Set(SectionName, "NoTriggerFilter", bNoTriggerFilter); iniFile.Set(SectionName, "NoTriggerFilter", bNoTriggerFilter);
iniFile.Set(SectionName, "TiltType", Tilt.Type);; iniFile.Set(SectionName, "TiltType", Tilt.Type);;
iniFile.Set(SectionName, "TiltRollRange", Tilt.Range.Roll); iniFile.Set(SectionName, "TiltRollRange", Tilt.Range.Roll);
@ -419,6 +420,7 @@ void Config::Save(int Slot)
iniFile.Set(SectionName, gh3ControlNames[x], WiiMoteEmu::PadMapping[i].GH3c.keyForControls[x]); iniFile.Set(SectionName, gh3ControlNames[x], WiiMoteEmu::PadMapping[i].GH3c.keyForControls[x]);
// Save the physical device ID number // Save the physical device ID number
iniFile.Set(SectionName, "Enabled", WiiMoteEmu::PadMapping[i].enabled);
iniFile.Set(SectionName, "DeviceID", WiiMoteEmu::PadMapping[i].ID); iniFile.Set(SectionName, "DeviceID", WiiMoteEmu::PadMapping[i].ID);
// Joypad specific settings // Joypad specific settings

View File

@ -98,6 +98,7 @@ struct Config
}; };
// Emulated Wiimote // Emulated Wiimote
bool bInputActive;
bool bSideways; bool bSideways;
bool bUpright; bool bUpright;
bool bWideScreen; bool bWideScreen;

View File

@ -31,12 +31,13 @@ BEGIN_EVENT_TABLE(WiimoteBasicConfigDialog,wxDialog)
EVT_BUTTON(ID_APPLY, WiimoteBasicConfigDialog::ButtonClick) EVT_BUTTON(ID_APPLY, WiimoteBasicConfigDialog::ButtonClick)
EVT_BUTTON(ID_BUTTONMAPPING, WiimoteBasicConfigDialog::ButtonClick) EVT_BUTTON(ID_BUTTONMAPPING, WiimoteBasicConfigDialog::ButtonClick)
EVT_BUTTON(ID_BUTTONRECORDING, WiimoteBasicConfigDialog::ButtonClick) EVT_BUTTON(ID_BUTTONRECORDING, WiimoteBasicConfigDialog::ButtonClick)
EVT_CHECKBOX(ID_CONNECT_REAL, WiimoteBasicConfigDialog::GeneralSettingsChanged) EVT_CHECKBOX(IDC_INPUT_ACTIVE, WiimoteBasicConfigDialog::GeneralSettingsChanged)
EVT_CHECKBOX(ID_USE_REAL, WiimoteBasicConfigDialog::GeneralSettingsChanged) EVT_CHECKBOX(IDC_CONNECT_REAL, WiimoteBasicConfigDialog::GeneralSettingsChanged)
EVT_CHECKBOX(ID_SIDEWAYSWIIMOTE, WiimoteBasicConfigDialog::GeneralSettingsChanged) EVT_CHECKBOX(IDC_USE_REAL, WiimoteBasicConfigDialog::GeneralSettingsChanged)
EVT_CHECKBOX(ID_UPRIGHTWIIMOTE, WiimoteBasicConfigDialog::GeneralSettingsChanged) EVT_CHECKBOX(IDC_SIDEWAYSWIIMOTE, WiimoteBasicConfigDialog::GeneralSettingsChanged)
EVT_CHECKBOX(ID_MOTIONPLUSCONNECTED, WiimoteBasicConfigDialog::GeneralSettingsChanged) EVT_CHECKBOX(IDC_UPRIGHTWIIMOTE, WiimoteBasicConfigDialog::GeneralSettingsChanged)
EVT_CHOICE(ID_EXTCONNECTED, WiimoteBasicConfigDialog::GeneralSettingsChanged) EVT_CHECKBOX(IDC_MOTIONPLUSCONNECTED, WiimoteBasicConfigDialog::GeneralSettingsChanged)
EVT_CHOICE(IDC_EXTCONNECTED, WiimoteBasicConfigDialog::GeneralSettingsChanged)
// IR cursor // IR cursor
EVT_COMMAND_SCROLL(IDS_WIDTH, WiimoteBasicConfigDialog::IRCursorChanged) EVT_COMMAND_SCROLL(IDS_WIDTH, WiimoteBasicConfigDialog::IRCursorChanged)
EVT_COMMAND_SCROLL(IDS_HEIGHT, WiimoteBasicConfigDialog::IRCursorChanged) EVT_COMMAND_SCROLL(IDS_HEIGHT, WiimoteBasicConfigDialog::IRCursorChanged)
@ -143,8 +144,8 @@ void WiimoteBasicConfigDialog::CreateGUIControls()
m_Controller[i] = new wxPanel(m_Notebook, ID_CONTROLLERPAGE1 + i, wxDefaultPosition, wxDefaultSize); m_Controller[i] = new wxPanel(m_Notebook, ID_CONTROLLERPAGE1 + i, wxDefaultPosition, wxDefaultSize);
m_Notebook->AddPage(m_Controller[i], wxString::Format(wxT("Wiimote %d"), i+1)); m_Notebook->AddPage(m_Controller[i], wxString::Format(wxT("Wiimote %d"), i+1));
m_ConnectRealWiimote[i] = new wxCheckBox(m_Controller[i], ID_CONNECT_REAL, wxT("Connect Real Wiimote")); m_ConnectRealWiimote[i] = new wxCheckBox(m_Controller[i], IDC_CONNECT_REAL, wxT("Connect Real Wiimote"));
m_UseRealWiimote[i] = new wxCheckBox(m_Controller[i], ID_USE_REAL, wxT("Use Real Wiimote")); m_UseRealWiimote[i] = new wxCheckBox(m_Controller[i], IDC_USE_REAL, wxT("Use Real Wiimote"));
m_ConnectRealWiimote[0]->SetValue(g_Config.bConnectRealWiimote); m_ConnectRealWiimote[0]->SetValue(g_Config.bConnectRealWiimote);
m_UseRealWiimote[0]->SetValue(g_Config.bUseRealWiimote); m_UseRealWiimote[0]->SetValue(g_Config.bUseRealWiimote);
@ -153,7 +154,7 @@ void WiimoteBasicConfigDialog::CreateGUIControls()
m_UseRealWiimote[i]->SetToolTip(wxT("Use the real Wiimote in the game. This can be changed during gameplay. This can not be selected") m_UseRealWiimote[i]->SetToolTip(wxT("Use the real Wiimote in the game. This can be changed during gameplay. This can not be selected")
wxT(" when a recording is to be done. No status in this window will be updated when this is checked.")); wxT(" when a recording is to be done. No status in this window will be updated when this is checked."));
m_WiiMotionPlusConnected[i] = new wxCheckBox(m_Controller[i], ID_MOTIONPLUSCONNECTED, wxT("Wii Motion Plus Connected")); m_WiiMotionPlusConnected[i] = new wxCheckBox(m_Controller[i], IDC_MOTIONPLUSCONNECTED, wxT("Wii Motion Plus Connected"));
m_WiiMotionPlusConnected[i]->SetValue(g_Config.bMotionPlusConnected); m_WiiMotionPlusConnected[i]->SetValue(g_Config.bMotionPlusConnected);
m_WiiMotionPlusConnected[i]->Enable(false); m_WiiMotionPlusConnected[i]->Enable(false);
@ -166,20 +167,19 @@ void WiimoteBasicConfigDialog::CreateGUIControls()
// Prolly needs to be a separate plugin // Prolly needs to be a separate plugin
//arrayStringFor_extension.Add(wxT("Balance Board")); //arrayStringFor_extension.Add(wxT("Balance Board"));
extensionChoice[i] = new wxChoice(m_Controller[i], ID_EXTCONNECTED, wxDefaultPosition, wxDefaultSize, arrayStringFor_extension, 0, wxDefaultValidator); extensionChoice[i] = new wxChoice(m_Controller[i], IDC_EXTCONNECTED, wxDefaultPosition, wxDefaultSize, arrayStringFor_extension, 0, wxDefaultValidator);
extensionChoice[i]->SetSelection(0); extensionChoice[i]->SetSelection(0);
// Basic Settings // Basic Settings
m_WiimoteOnline[i] = new wxCheckBox(m_Controller[i], IDC_WIMOTE_ON, wxT("Wiimote On")); m_InputActive[i] = new wxCheckBox(m_Controller[i], IDC_INPUT_ACTIVE, wxT("Wiimote Input Active"));
m_WiimoteOnline[i]->SetValue(true); m_InputActive[i]->SetValue(true);
m_WiimoteOnline[i]->Enable(false); m_InputActive[i]->SetToolTip(wxString::Format(wxT("Decide if Wiimote button events shall be sent to game"), i));
m_WiimoteOnline[i]->SetToolTip(wxString::Format(wxT("Decide if Wiimote %i shall be detected by the game"), i));
// Emulated Wiimote // Emulated Wiimote
m_SidewaysWiimote[i] = new wxCheckBox(m_Controller[i], ID_SIDEWAYSWIIMOTE, wxT("Sideways Wiimote")); m_SidewaysWiimote[i] = new wxCheckBox(m_Controller[i], IDC_SIDEWAYSWIIMOTE, wxT("Sideways Wiimote"));
m_SidewaysWiimote[i]->SetValue(g_Config.bSideways); m_SidewaysWiimote[i]->SetValue(g_Config.bSideways);
m_SidewaysWiimote[i]->SetToolTip(wxT("Treat the sideways position as neutral")); m_SidewaysWiimote[i]->SetToolTip(wxT("Treat the sideways position as neutral"));
m_UprightWiimote[i] = new wxCheckBox(m_Controller[i], ID_UPRIGHTWIIMOTE, wxT("Upright Wiimote")); m_UprightWiimote[i] = new wxCheckBox(m_Controller[i], IDC_UPRIGHTWIIMOTE, wxT("Upright Wiimote"));
m_UprightWiimote[i]->SetValue(g_Config.bUpright); m_UprightWiimote[i]->SetValue(g_Config.bUpright);
m_UprightWiimote[i]->SetToolTip(wxT("Treat the upright position as neutral")); m_UprightWiimote[i]->SetToolTip(wxT("Treat the upright position as neutral"));
@ -212,8 +212,8 @@ void WiimoteBasicConfigDialog::CreateGUIControls()
m_Crop[i]->Enable(false); m_Crop[i]->Enable(false);
// Sizers // Sizers
m_SizeBasic[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("General Settings")); m_SizeBasic[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("Emulated Wiimote"));
m_SizeBasic[i]->Add(m_WiimoteOnline[i], 0, wxEXPAND | wxALL, 5); m_SizeBasic[i]->Add(m_InputActive[i], 0, wxEXPAND | wxALL, 5);
m_SizeEmu[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("Emulated Position")); m_SizeEmu[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("Emulated Position"));
m_SizeEmu[i]->Add(m_SidewaysWiimote[i], 0, wxEXPAND | wxALL, 5); m_SizeEmu[i]->Add(m_SidewaysWiimote[i], 0, wxEXPAND | wxALL, 5);
@ -294,7 +294,7 @@ void WiimoteBasicConfigDialog::CreateGUIControls()
// Center the window if there is room for it // Center the window if there is room for it
#ifdef _WIN32 #ifdef _WIN32
if (GetSystemMetrics(SM_CYFULLSCREEN) > 800) if (GetSystemMetrics(SM_CYFULLSCREEN) > 600)
Center(); Center();
#endif #endif
ControlsCreated = true; ControlsCreated = true;
@ -369,26 +369,29 @@ void WiimoteBasicConfigDialog::GeneralSettingsChanged(wxCommandEvent& event)
{ {
switch (event.GetId()) switch (event.GetId())
{ {
case ID_CONNECT_REAL: case IDC_CONNECT_REAL:
DoConnectReal(); DoConnectReal();
break; break;
case ID_USE_REAL: case IDC_USE_REAL:
// Enable the Wiimote thread // Enable the Wiimote thread
g_Config.bUseRealWiimote = m_UseRealWiimote[Page]->IsChecked(); g_Config.bUseRealWiimote = m_UseRealWiimote[Page]->IsChecked();
if (g_Config.bUseRealWiimote) DoUseReal(); if (g_Config.bUseRealWiimote) DoUseReal();
break; break;
case ID_SIDEWAYSWIIMOTE: case IDC_INPUT_ACTIVE:
g_Config.bInputActive = m_InputActive[Page]->IsChecked();
break;
case IDC_SIDEWAYSWIIMOTE:
g_Config.bSideways = m_SidewaysWiimote[Page]->IsChecked(); g_Config.bSideways = m_SidewaysWiimote[Page]->IsChecked();
break; break;
case ID_UPRIGHTWIIMOTE: case IDC_UPRIGHTWIIMOTE:
g_Config.bUpright = m_UprightWiimote[Page]->IsChecked(); g_Config.bUpright = m_UprightWiimote[Page]->IsChecked();
break; break;
case ID_MOTIONPLUSCONNECTED: case IDC_MOTIONPLUSCONNECTED:
g_Config.bMotionPlusConnected = m_WiiMotionPlusConnected[Page]->IsChecked(); g_Config.bMotionPlusConnected = m_WiiMotionPlusConnected[Page]->IsChecked();
break; break;
case ID_EXTCONNECTED: case IDC_EXTCONNECTED:
g_Config.iExtensionConnected = EXT_NONE; g_Config.iExtensionConnected = EXT_NONE;
// Disconnect the extension so that the game recognize the change // Disconnect the extension so that the game recognize the change
DoExtensionConnectedDisconnected(); DoExtensionConnectedDisconnected();

View File

@ -52,13 +52,13 @@ class WiimoteBasicConfigDialog : public wxDialog
// Timers // Timers
wxTimer *m_TimeoutOnce, wxTimer *m_TimeoutOnce,
*m_ShutDownTimer; *m_ShutDownTimer;
wxCheckBox *m_UseRealWiimote[4]; wxCheckBox *m_UseRealWiimote[4];
private: private:
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
bool ControlsCreated, bool ControlsCreated, m_bEnableUseRealWiimote;
m_bEnableUseRealWiimote;
int Page; int Page;
wxNotebook *m_Notebook; wxNotebook *m_Notebook;
@ -68,19 +68,17 @@ class WiimoteBasicConfigDialog : public wxDialog
*m_ButtonMapping, *m_ButtonMapping,
*m_Recording; *m_Recording;
wxBoxSizer *m_MainSizer, wxChoice* extensionChoice[4];
*m_sMain[4],
*m_SizeParent[4];
wxSlider *m_SliderWidth[4], wxSlider *m_SliderWidth[4],
*m_SliderHeight[4], *m_SliderHeight[4],
*m_SliderLeft[4], *m_SliderLeft[4],
*m_SliderTop[4]; *m_SliderTop[4];
// Emulated Wiimote settings wxCheckBox *m_InputActive[4],
wxCheckBox *m_SidewaysWiimote[4], *m_SidewaysWiimote[4],
*m_UprightWiimote[4], *m_UprightWiimote[4],
*m_WiimoteOnline[4], *m_ConnectRealWiimote[4],
*m_WiiMotionPlusConnected[4], *m_WiiMotionPlusConnected[4],
*m_CheckAR43[4], *m_CheckAR43[4],
*m_CheckAR169[4], *m_CheckAR169[4],
@ -91,7 +89,11 @@ class WiimoteBasicConfigDialog : public wxDialog
*m_TextScreenLeft[4], *m_TextScreenLeft[4],
*m_TextScreenTop[4], *m_TextScreenTop[4],
*m_TextAR[4]; *m_TextAR[4];
wxBoxSizer *m_SizeBasicGeneral[4],
wxBoxSizer *m_MainSizer,
*m_sMain[4],
*m_SizeParent[4],
*m_SizeBasicGeneral[4],
*m_SizeBasicGeneralLeft[4], *m_SizeBasicGeneralLeft[4],
*m_SizeBasicGeneralRight[4], *m_SizeBasicGeneralRight[4],
*m_SizerIRPointerWidth[4], *m_SizerIRPointerWidth[4],
@ -104,11 +106,6 @@ class WiimoteBasicConfigDialog : public wxDialog
*m_SizeExtensions[4], *m_SizeExtensions[4],
*m_SizerIRPointer[4]; *m_SizerIRPointer[4];
wxChoice* extensionChoice[4];
// Real Wiimote settings
wxCheckBox *m_ConnectRealWiimote[4];
enum enum
{ {
ID_CLOSE = 1000, ID_CLOSE = 1000,
@ -126,20 +123,20 @@ class WiimoteBasicConfigDialog : public wxDialog
ID_CONTROLLERPAGE4, ID_CONTROLLERPAGE4,
// Emulated Wiimote // Emulated Wiimote
ID_SIDEWAYSWIIMOTE, IDC_INPUT_ACTIVE,
ID_UPRIGHTWIIMOTE, IDC_SIDEWAYSWIIMOTE,
ID_MOTIONPLUSCONNECTED, IDC_UPRIGHTWIIMOTE,
ID_EXTCONNECTED, IDC_MOTIONPLUSCONNECTED,
IDC_WIMOTE_ON, IDC_EXTCONNECTED,
// Real
IDC_CONNECT_REAL,
IDC_USE_REAL,
IDS_WIDTH, IDS_WIDTH,
IDS_HEIGHT, IDS_HEIGHT,
IDS_LEFT, IDS_LEFT,
IDS_TOP, IDS_TOP,
// Real
ID_CONNECT_REAL,
ID_USE_REAL,
}; };
void OnClose(wxCloseEvent& event); void OnClose(wxCloseEvent& event);

View File

@ -914,7 +914,7 @@ void WiimotePadConfigDialog::CreatePadGUIControls()
// Center the window if there is room for it // Center the window if there is room for it
#ifdef _WIN32 #ifdef _WIN32
if (GetSystemMetrics(SM_CYFULLSCREEN) > 800) if (GetSystemMetrics(SM_CYFULLSCREEN) > 600)
Center(); Center();
#endif #endif

View File

@ -633,17 +633,22 @@ void Update()
if(g_ReportingAuto == false) if(g_ReportingAuto == false)
return; return;
readKeyboard(); // Read input or not
// Check if the pad state should be updated if (g_Config.bInputActive)
{
ReadLinuxKeyboard();
/*
if ((g_Config.Tilt.Type == g_Config.Tilt.TRIGGER || g_Config.Tilt.Type == g_Config.Tilt.ANALOG1 || g_Config.Tilt.Type == g_Config.Tilt.ANALOG2 if ((g_Config.Tilt.Type == g_Config.Tilt.TRIGGER || g_Config.Tilt.Type == g_Config.Tilt.ANALOG1 || g_Config.Tilt.Type == g_Config.Tilt.ANALOG2
|| g_Config.Nunchuck.Type == g_Config.Nunchuck.ANALOG1 || g_Config.Nunchuck.Type == g_Config.Nunchuck.ANALOG2 || g_Config.Nunchuck.Type == g_Config.Nunchuck.ANALOG1 || g_Config.Nunchuck.Type == g_Config.Nunchuck.ANALOG2
|| g_Config.ClassicController.LType == g_Config.ClassicController.ANALOG1 || g_Config.ClassicController.LType == g_Config.ClassicController.ANALOG2 || g_Config.ClassicController.LType == g_Config.ClassicController.ANALOG1 || g_Config.ClassicController.LType == g_Config.ClassicController.ANALOG2
|| g_Config.ClassicController.RType == g_Config.ClassicController.ANALOG1 || g_Config.ClassicController.RType == g_Config.ClassicController.ANALOG2) || g_Config.ClassicController.RType == g_Config.ClassicController.ANALOG1 || g_Config.ClassicController.RType == g_Config.ClassicController.ANALOG2)
&& NumGoodPads > 0 && joyinfo.size() > (u32)PadMapping[0].ID) && NumGoodPads > 0 && joyinfo.size() > (u32)PadMapping[0].ID)
{ */
// Check if the pad state should be updated
const int Page = 0; const int Page = 0;
WiiMoteEmu::GetJoyState(PadState[Page], PadMapping[Page], Page, joyinfo[PadMapping[Page].ID].NumButtons); if (NumGoodPads > 0 && joyinfo.size() > (u32)PadMapping[Page].ID)
WiiMoteEmu::GetJoyState(PadState[Page], PadMapping[Page], Page, joyinfo[PadMapping[Page].ID].NumButtons);
} }
switch(g_ReportingMode) switch(g_ReportingMode)
@ -669,7 +674,7 @@ void Update()
} }
void readKeyboard() void ReadLinuxKeyboard()
{ {
#if defined(HAVE_X11) && HAVE_X11 #if defined(HAVE_X11) && HAVE_X11
XEvent E; XEvent E;

View File

@ -41,7 +41,7 @@ void Shutdown(void);
void InterruptChannel(u16 _channelID, const void* _pData, u32 _Size); void InterruptChannel(u16 _channelID, const void* _pData, u32 _Size);
void ControlChannel(u16 _channelID, const void* _pData, u32 _Size) ; void ControlChannel(u16 _channelID, const void* _pData, u32 _Size) ;
void Update(); void Update();
void readKeyboard(); void ReadLinuxKeyboard();
// Recordings // Recordings
void LoadRecordedMovements(); void LoadRecordedMovements();

View File

@ -299,24 +299,27 @@ int RecordingCheckKeys(int WmNuIr)
int GetMapKeyState(int _MapKey, int Key) int GetMapKeyState(int _MapKey, int Key)
{ {
const int Page = 0; if (g_Config.bInputActive)
if (_MapKey < 256)
#ifdef _WIN32
return GetAsyncKeyState(_MapKey); // Keyboard (Windows)
#else
return KeyStatus[Key]; // Keyboard (Linux)
#endif
if (_MapKey < 0x1100)
return SDL_JoystickGetButton(PadState[Page].joy, _MapKey - 0x1000); // Pad button
else // Pad hat
{ {
u8 HatCode, HatKey; const int Page = 0;
HatCode = SDL_JoystickGetHat(PadState[Page].joy, (_MapKey - 0x1100) / 0x0010);
HatKey = (_MapKey - 0x1100) % 0x0010;
if (HatCode & HatKey) if (_MapKey < 256)
return HatKey; #ifdef _WIN32
return GetAsyncKeyState(_MapKey); // Keyboard (Windows)
#else
return KeyStatus[Key]; // Keyboard (Linux)
#endif
if (_MapKey < 0x1100)
return SDL_JoystickGetButton(PadState[Page].joy, _MapKey - 0x1000); // Pad button
else // Pad hat
{
u8 HatCode, HatKey;
HatCode = SDL_JoystickGetHat(PadState[Page].joy, (_MapKey - 0x1100) / 0x0010);
HatKey = (_MapKey - 0x1100) % 0x0010;
if (HatCode & HatKey)
return HatKey;
}
} }
return NULL; return NULL;
} }