mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
nJoy: Preparation for fixing the digital pad and the analog triggers
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1928 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -128,6 +128,43 @@ void ConfigBox::PadGetStatus()
|
||||
|
||||
}
|
||||
|
||||
// Show the current pad status
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
std::string ShowStatus()
|
||||
{
|
||||
SDL_Joystick *joy = SDL_JoystickOpen(0);
|
||||
int axes = SDL_JoystickNumAxes(joy);
|
||||
int hats = SDL_JoystickNumHats(joy);
|
||||
int but = SDL_JoystickNumButtons(joy);
|
||||
std::string StrAxes, StrHats, StrBut;
|
||||
int value;
|
||||
|
||||
// Go through all axes and read out their values
|
||||
SDL_JoystickUpdate();
|
||||
for(int i = 0; i < axes; i++)
|
||||
{
|
||||
value = SDL_JoystickGetAxis(joy, i);
|
||||
StrAxes += StringFromFormat(" %i:%05i", i, value);
|
||||
}
|
||||
for(int i = 0;i < hats; i++)
|
||||
{
|
||||
value = SDL_JoystickGetHat(joy, i);
|
||||
StrHats += StringFromFormat(" %i:%i", i, value);
|
||||
}
|
||||
for(int i = 0;i < but; i++)
|
||||
{
|
||||
value = SDL_JoystickGetButton(joy, i);
|
||||
StrBut += StringFromFormat(" %i:%i", i+1, value);
|
||||
}
|
||||
|
||||
return StringFromFormat(
|
||||
"Axes: %s\nHats: %s\nBut: %s\nDevice: Ax: %i Balls:%i But:%i Hats:%i",
|
||||
StrAxes.c_str(), StrHats.c_str(), StrBut.c_str(),
|
||||
joyinfo[joysticks[0].ID].NumAxes, joyinfo[joysticks[0].ID].NumBalls,
|
||||
joyinfo[joysticks[0].ID].NumButtons, joyinfo[joysticks[0].ID].NumHats
|
||||
);
|
||||
}
|
||||
|
||||
// Populate the advanced tab
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void ConfigBox::Update()
|
||||
@ -135,11 +172,11 @@ void ConfigBox::Update()
|
||||
if(StrangeHack) PadGetStatus();
|
||||
if(!g_Config.bShowAdvanced) StrangeHack = false; else StrangeHack = true;
|
||||
|
||||
/*
|
||||
// Show the current status
|
||||
/**/
|
||||
m_pStatusBar->SetLabel(wxString::Format(
|
||||
"Id: %i",
|
||||
joysticks[0].ID
|
||||
));*/
|
||||
"%s", ShowStatus().c_str()
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user