Browse Source

Add back the logic to first check if keybinding length is correct.

Yao Wei Tjong 姚伟忠 10 years ago
parent
commit
f7a30b8306
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Source/Urho3D/Input/Input.cpp

+ 1 - 1
Source/Urho3D/Input/Input.cpp

@@ -772,7 +772,7 @@ SDL_JoystickID Input::AddScreenJoystick(XMLFile* layoutFile, XMLFile* styleFile)
                 Vector<String> keyBindings;
                 if (keyBinding.Contains(' '))   // e.g.: "UP DOWN LEFT RIGHT"
                     keyBindings = keyBinding.Split(' ');    // Attempt to split the text using ' ' as separator
-                else
+                else if (keyBinding.Length() == 4)
                 {
                     keyBindings.Resize(4);      // e.g.: "WSAD"
                     for (unsigned i = 0; i < 4; ++i)