Fixed keyboard configuration. For some reason, the code that sensed keyboard input disappear... weird

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5024 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2010-03-19 01:02:40 +00:00
parent fad4cb4c01
commit 2f236cb6ea

View File

@ -183,20 +183,40 @@ void InputManager::handleStaticAction(int key, int value)
*/
void InputManager::inputSensing(Input::InputType type, int deviceID, int btnID, int axisDirection, int value)
{
#if INPUT_MODE_DEBUG
std::cout << "INPUT SENSING... ";
#endif
bool store_new = true;
// don't store if we're trying to do something like bindings keyboard keys on a gamepad
if(m_mode == INPUT_SENSE_KEYBOARD && type != Input::IT_KEYBOARD) store_new = false;
if(m_mode == INPUT_SENSE_GAMEPAD && type != Input::IT_STICKMOTION && type != Input::IT_STICKBUTTON) store_new = false;
if (m_mode == INPUT_SENSE_KEYBOARD && type != Input::IT_KEYBOARD)
{
store_new = false;
}
if (m_mode == INPUT_SENSE_GAMEPAD && type != Input::IT_STICKMOTION && type != Input::IT_STICKBUTTON)
{
store_new = false;
}
#if INPUT_MODE_DEBUG
std::cout << (store_new ? "storing it" : "ignoring it") << "\n";
#endif
if (store_new)
{
m_sensed_input->type = type;
m_sensed_input->deviceID = deviceID;
m_sensed_input->btnID = btnID;
m_sensed_input->axisDirection = axisDirection;
if(type == Input::IT_STICKMOTION)
if (type == Input::IT_KEYBOARD)
{
OptionsScreenInput::getInstance()->gotSensedInput(m_sensed_input);
return;
}
else if (type == Input::IT_STICKMOTION)
{
std::cout << "%% storing new axis binding, value=" << value <<
" deviceID=" << deviceID << " btnID=" << btnID << " axisDirection=" <<