MCPcopy Create free account
hub / github.com/OpenMW/openmw / loadKeyBinders

Method loadKeyBinders

extern/oics/ICSInputControlSystem_keyboard.cpp:31–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29namespace ICS
30{
31 void InputControlSystem::loadKeyBinders(TiXmlElement* xmlControlNode)
32 {
33 TiXmlElement* xmlKeyBinder = xmlControlNode->FirstChildElement("KeyBinder");
34 while(xmlKeyBinder)
35 {
36 Control::ControlChangingDirection dir = Control::STOP;
37 if(std::string(xmlKeyBinder->Attribute("direction")) == "INCREASE")
38 {
39 dir = Control::INCREASE;
40 }
41 else if(std::string(xmlKeyBinder->Attribute("direction")) == "DECREASE")
42 {
43 dir = Control::DECREASE;
44 }
45
46 addKeyBinding(mControls.back(), SDL_Scancode(FromString<int>(xmlKeyBinder->Attribute("key"))), dir);
47
48 xmlKeyBinder = xmlKeyBinder->NextSiblingElement("KeyBinder");
49 }
50 }
51
52 void InputControlSystem::addKeyBinding(Control* control, SDL_Scancode key, Control::ControlChangingDirection direction)
53 {

Callers

nothing calls this directly

Calls 3

AttributeMethod · 0.80
FirstChildElementMethod · 0.45
NextSiblingElementMethod · 0.45

Tested by

no test coverage detected