Changeset 3274 for code/branches/core4/src/core/input/KeyBinder.cc
- Timestamp:
- Jul 12, 2009, 4:12:04 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core4/src/core/input/KeyBinder.cc
r3269 r3274 100 100 101 101 // initialise joy sticks separatly to allow for reloading 102 numberOfJoySticks_ = InputManager::getInstance(). numberOfJoySticks();102 numberOfJoySticks_ = InputManager::getInstance().getJoyStickQuantity(); 103 103 initialiseJoyStickBindings(); 104 104 … … 152 152 } 153 153 154 void KeyBinder::JoyStick DeviceNumberChanged(unsigned int value)154 void KeyBinder::JoyStickQuantityChanged(unsigned int value) 155 155 { 156 156 unsigned int oldValue = numberOfJoySticks_; … … 311 311 } 312 312 313 void KeyBinder:: updateMouse(float dt)313 void KeyBinder::mouseUpdated(float dt) 314 314 { 315 315 if (bDeriveMouseInput_) … … 364 364 } 365 365 366 void KeyBinder:: updateJoyStick(float dt, unsigned int joyStick)366 void KeyBinder::joyStickUpdated(unsigned int joyStick, float dt) 367 367 { 368 368 for (unsigned int i = 0; i < JoyStickAxisCode::numberOfAxes * 2; i++) … … 480 480 } 481 481 482 void KeyBinder::joyStickAxisMoved(unsigned int joyStickID, unsigned int axis, float value) 483 { 484 int i = axis * 2; 482 void KeyBinder::axisMoved(unsigned int device, unsigned int axisID, float value) 483 { 484 int i = axisID * 2; 485 JoyStickAxisVector& axis = joyStickAxes_[device]; 485 486 if (value < 0) 486 487 { 487 joyStickAxes_[joyStickID][i].absVal_ = -value;488 joyStickAxes_[joyStickID][i].relVal_ = -value;489 joyStickAxes_[joyStickID][i].hasChanged_ = true;490 if ( joyStickAxes_[joyStickID][i + 1].absVal_ > 0.0f)491 { 492 joyStickAxes_[joyStickID][i + 1].absVal_ = -0.0f;493 joyStickAxes_[joyStickID][i + 1].relVal_ = -0.0f;494 joyStickAxes_[joyStickID][i + 1].hasChanged_ = true;488 axis[i].absVal_ = -value; 489 axis[i].relVal_ = -value; 490 axis[i].hasChanged_ = true; 491 if (axis[i + 1].absVal_ > 0.0f) 492 { 493 axis[i + 1].absVal_ = -0.0f; 494 axis[i + 1].relVal_ = -0.0f; 495 axis[i + 1].hasChanged_ = true; 495 496 } 496 497 } 497 498 else 498 499 { 499 joyStickAxes_[joyStickID][i + 1].absVal_ = value;500 joyStickAxes_[joyStickID][i + 1].relVal_ = value;501 joyStickAxes_[joyStickID][i + 1].hasChanged_ = true;502 if ( joyStickAxes_[joyStickID][i].absVal_ > 0.0f)503 { 504 joyStickAxes_[joyStickID][i].absVal_ = -0.0f;505 joyStickAxes_[joyStickID][i].relVal_ = -0.0f;506 joyStickAxes_[joyStickID][i].hasChanged_ = true;500 axis[i + 1].absVal_ = value; 501 axis[i + 1].relVal_ = value; 502 axis[i + 1].hasChanged_ = true; 503 if (axis[i].absVal_ > 0.0f) 504 { 505 axis[i].absVal_ = -0.0f; 506 axis[i].relVal_ = -0.0f; 507 axis[i].hasChanged_ = true; 507 508 } 508 509 }
Note: See TracChangeset
for help on using the changeset viewer.