summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.cpp
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2008-10-11 00:23:26 +0000
committerShawn Hoffman <godisgovernment@gmail.com>2008-10-11 00:23:26 +0000
commit540539ee274bf2243b7fe28db280aa9e8b665b62 (patch)
tree2612b0fd4be00e0351c777521d6508b068ec102a /Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.cpp
parent92f661b3904831022314bacbd759eade561ae572 (diff)
padsimple: now shows only which xpads are connected (when the config is called), set all pads to keyboard as default, got rid of XINPUT_ENABLE #ifdefs, made the trigger buttons enabled at 200/255 instead of 20/255 :) hopefully that's a lot closer to how a gc controller acts.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@832 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.cpp')
-rw-r--r--Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.cpp b/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.cpp
index c72c5f2d5f..fc4bdcb95c 100644
--- a/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.cpp
+++ b/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.cpp
@@ -20,6 +20,7 @@
#include "../PadSimple.h"
#ifdef _WIN32
+#include "XInput.h"
#include "../DirectInputBase.h"
DInput m_dinput;
@@ -142,14 +143,21 @@ void ConfigDialog::CreateGUIControls()
m_Disable[i]->SetValue(pad[i].disable);
m_Rumble[i]->SetValue(pad[i].rumble);
m_Rumble[i]->Enable(!pad[i].keyboard);
-
- // This should be considered TEMPORARY until polling x360 pads is implemented
+
m_DeviceName[i]->Append(_("Keyboard"));
- m_DeviceName[i]->Append(_("XPAD1"));
- m_DeviceName[i]->Append(_("XPAD2"));
- m_DeviceName[i]->Append(_("XPAD3"));
- m_DeviceName[i]->Append(_("XPAD4"));
+#ifdef _WIN32
+ // Add connected XPads
+ for (int x = 0; x < 4; x++)
+ {
+ XINPUT_STATE xstate;
+ DWORD xresult = XInputGetState(x, &xstate);
+ if (xresult == ERROR_SUCCESS)
+ {
+ m_DeviceName[i]->Append(wxString::Format("XPad %i", x+1));
+ }
+ }
+#endif
sDeviceTop[i]->Add(m_DeviceName[i], 1, wxEXPAND|wxALL, 1);
sDeviceTop[i]->Add(m_Attached[i], 0, wxEXPAND|wxALL, 1);
sDeviceBottom[i]->AddStretchSpacer(1);