Fix #1170 Add "Don't Assign" option when configuring inputs
This commit is contained in:
parent
a4ac9f95c2
commit
0193c4c7a5
@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
<button id="assignEsc" I18N="When configuring input" text="Assign to ESC key" align="center"/>
|
<button id="assignEsc" I18N="When configuring input" text="Assign to ESC key" align="center"/>
|
||||||
<spacer height="10" width="10" />
|
<spacer height="10" width="10" />
|
||||||
|
<button id="assignNone" I18N="When configuring input" text="Assign nothing" align="center"/>
|
||||||
|
<spacer height="10" width="10" />
|
||||||
<button id="cancel" I18N="When configuring input" text="Press ESC to cancel" align="center"/>
|
<button id="cancel" I18N="When configuring input" text="Press ESC to cancel" align="center"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -83,6 +83,10 @@ irr::core::stringw DeviceConfig::getMappingIdString (const PlayerAction action)
|
|||||||
returnString += id;
|
returnString += id;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Input::IT_NONE:
|
||||||
|
returnString += "none";
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
returnString += type;
|
returnString += type;
|
||||||
|
@ -44,6 +44,12 @@ GUIEngine::EventPropagation PressAKeyDialog::processEvent(const std::string& eve
|
|||||||
dismiss();
|
dismiss();
|
||||||
return GUIEngine::EVENT_BLOCK;
|
return GUIEngine::EVENT_BLOCK;
|
||||||
}
|
}
|
||||||
|
else if (eventSource == "assignNone")
|
||||||
|
{
|
||||||
|
Input simulatedInput;
|
||||||
|
OptionsScreenInput2::getInstance()->gotSensedInput(simulatedInput);
|
||||||
|
return GUIEngine::EVENT_BLOCK;
|
||||||
|
}
|
||||||
else if (eventSource == "assignEsc")
|
else if (eventSource == "assignEsc")
|
||||||
{
|
{
|
||||||
Input simulatedInput(Input::IT_KEYBOARD, 0 /* deviceID */, KEY_ESCAPE);
|
Input simulatedInput(Input::IT_KEYBOARD, 0 /* deviceID */, KEY_ESCAPE);
|
||||||
|
@ -447,6 +447,23 @@ void OptionsScreenInput2::gotSensedInput(const Input& sensed_input)
|
|||||||
updateInputButtons();
|
updateInputButtons();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (sensed_input.m_type == Input::IT_NONE)
|
||||||
|
{
|
||||||
|
if (UserConfigParams::logMisc())
|
||||||
|
{
|
||||||
|
std::cout << "% Binding " << KartActionStrings[binding_to_set]
|
||||||
|
<< " : setting to keyboard key NONE\n\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
KeyboardConfig* keyboard = (KeyboardConfig*)m_config;
|
||||||
|
keyboard->setBinding(binding_to_set, Input::IT_NONE,
|
||||||
|
sensed_input.m_button_id, Input::AD_NEUTRAL,
|
||||||
|
Input::AR_HALF,
|
||||||
|
sensed_input.m_character);
|
||||||
|
|
||||||
|
// refresh display
|
||||||
|
updateInputButtons();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user