void CInput::LoadKeyBindings() { std::stringstream skey; std::string keys; if (CConfigFile::GetInstancePointer()->GetStringProperty("Keybindings", "_Version", keys) && keys == "SDL2") // Keybindings from SDL1.2 are incompatible with SDL2 !! { for (int i = 0; i < INPUT_SLOT_MAX; i++) { InputBinding b; if (!CConfigFile::GetInstancePointer()->GetStringProperty("Keybindings", m_keyTable[static_cast<InputSlot>(i)], keys)) continue; skey.clear(); skey.str(keys); skey >> b.primary; skey >> b.secondary; SetInputBinding(static_cast<InputSlot>(i), b); } } for (int i = 0; i < JOY_AXIS_SLOT_MAX; i++) { JoyAxisBinding b; if (!CConfigFile::GetInstancePointer()->GetIntProperty("Setup", "JoystickAxisBinding"+boost::lexical_cast<std::string>(i), b.axis)) continue; int x = 0; CConfigFile::GetInstancePointer()->GetIntProperty("Setup", "JoystickAxisInvert"+boost::lexical_cast<std::string>(i), x); // If doesn't exist, use default (0) b.invert = (x != 0); SetJoyAxisBinding(static_cast<JoyAxisSlot>(i), b); } float deadzone; if (CConfigFile::GetInstancePointer()->GetFloatProperty("Setup", "JoystickDeadzone", deadzone)) SetJoystickDeadzone(deadzone); }
OneToManyOutputsBinding::OneToManyOutputsBinding(IBinding* inBinding) { SetInputBinding(inBinding); }