show InputDevice name next to description
This commit is contained in:
@@ -31,16 +31,18 @@ void ScreenTestInput::Init()
|
|||||||
{
|
{
|
||||||
vector<InputDevice> vDevices;
|
vector<InputDevice> vDevices;
|
||||||
vector<CString> vDescriptions;
|
vector<CString> vDescriptions;
|
||||||
|
vector<CString> vs;
|
||||||
INPUTMAN->GetDevicesAndDescriptions( vDevices, vDescriptions );
|
INPUTMAN->GetDevicesAndDescriptions( vDevices, vDescriptions );
|
||||||
FOREACH( CString, vDescriptions, s )
|
ASSERT( vDevices.size() == vDescriptions.size() );
|
||||||
|
for( int i=0; i<vDevices.size(); ++i )
|
||||||
{
|
{
|
||||||
if( *s == "MonkeyKeyboard" )
|
const CString sDescription = vDescriptions[i];
|
||||||
{
|
InputDevice device = vDevices[i];
|
||||||
vDescriptions.erase( s );
|
if( sDescription == "MonkeyKeyboard" )
|
||||||
break;
|
continue; // hide this
|
||||||
}
|
vs.push_back( ssprintf("%s (%s)", sDescription.c_str(), InputDeviceToString(device).c_str()) );
|
||||||
}
|
}
|
||||||
m_textDevices.SetText( join("\n",vDescriptions) );
|
m_textDevices.SetText( join("\n",vs) );
|
||||||
}
|
}
|
||||||
this->AddChild( &m_textDevices );
|
this->AddChild( &m_textDevices );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user