Changeset 1347
- Timestamp:
- May 21, 2008, 8:56:31 PM (17 years ago)
- Location:
- code/branches/input/src/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/input/src/core/InputHandler.cc
r1344 r1347 181 181 182 182 // evaluate the command 183 CommandEvaluation &eval = CommandExecutor::evaluate(commandStr);183 CommandEvaluation eval = CommandExecutor::evaluate(commandStr); 184 184 if (!eval.isValid()) 185 185 continue; … … 405 405 "MYCOMPUTER", "MAIL", "MEDIASELECT" 406 406 }; 407 for ( int i = 0; i < nKeys_s; i++)407 for (unsigned int i = 0; i < nKeys_s; i++) 408 408 keys_[i].name_ = "Key" + keyNames[i]; 409 409 … … 415 415 "MouseWheel1Up", "MouseWheel1Down", 416 416 "MouseWheel2Up", "MouseWheel2Down" }; 417 for ( int i = 0; i < nMouseButtons_s; i++)417 for (unsigned int i = 0; i < nMouseButtons_s; i++) 418 418 mouseButtons_[i].name_ = mouseButtonNames[i]; 419 419 420 420 // joy stick buttons 421 for ( int i = 0; i < 32; i++)421 for (unsigned int i = 0; i < 32; i++) 422 422 joyStickButtons_[i].name_ = "JoyButton" + getConvertedValue<int, std::string>(i); 423 for ( int i = 32; i < nJoyStickButtons_s; i += 4)423 for (unsigned int i = 32; i < nJoyStickButtons_s; i += 4) 424 424 { 425 425 joyStickButtons_[i + 0].name_ = "JoyPOV" + getConvertedValue<int, std::string>((i - 32)/4 + 1) + "North"; … … 527 527 void KeyBinder::clearBindings(bool bInit) 528 528 { 529 for ( int i = 0; i < nKeys_s; i++)529 for (unsigned int i = 0; i < nKeys_s; i++) 530 530 keys_[i].clear(); 531 531 532 for ( int i = 0; i < nMouseButtons_s; i++)532 for (unsigned int i = 0; i < nMouseButtons_s; i++) 533 533 mouseButtons_[i].clear(); 534 534 535 for ( int i = 0; i < nJoyStickButtons_s; i++)535 for (unsigned int i = 0; i < nJoyStickButtons_s; i++) 536 536 joyStickButtons_[i].clear(); 537 537 538 for ( int i = 0; i < nHalfAxes_s; i++)538 for (unsigned int i = 0; i < nHalfAxes_s; i++) 539 539 halfAxes_[i].clear(); 540 540 … … 588 588 if (mouseRelative_[i] > 0) 589 589 { 590 halfAxes_[2*i + 0].absVal_ = mouseRelative_[i] * derivePeriod_ / 500 ;590 halfAxes_[2*i + 0].absVal_ = mouseRelative_[i] * derivePeriod_ / 500 * mouseSensitivity_; 591 591 halfAxes_[2*i + 1].absVal_ = 0.0f; 592 592 } … … 594 594 { 595 595 halfAxes_[2*i + 0].absVal_ = 0.0f; 596 halfAxes_[2*i + 1].absVal_ = -mouseRelative_[i] * derivePeriod_ / 500 ;596 halfAxes_[2*i + 1].absVal_ = -mouseRelative_[i] * derivePeriod_ / 500 * mouseSensitivity_; 597 597 } 598 598 COUT(3) << mouseRelative_[i] << " | "; 599 mouseRelative_[i] = 0 .0f;599 mouseRelative_[i] = 0; 600 600 } 601 601 COUT(3) << std::endl; … … 652 652 { 653 653 // y axis of mouse input is inverted 654 int rel[] = { rel_.x * mouseSensitivity_, -rel_.y * mouseSensitivity_};654 int rel[] = { rel_.x, -rel_.y }; 655 655 656 656 COUT(3) << rel[0] << " | " << rel[1] << std::endl; … … 668 668 { 669 669 halfAxes_[1 + 2*i].hasChanged_ = true; 670 halfAxes_[1 + 2*i].absVal_ = -((float)mousePosition_[i])/1024 ;670 halfAxes_[1 + 2*i].absVal_ = -((float)mousePosition_[i])/1024 * mouseSensitivity_; 671 671 halfAxes_[0 + 2*i].absVal_ = 0.0f; 672 672 } 673 673 else 674 halfAxes_[1 + 2*i].absVal_ = ((float)mousePosition_[i])/1024 ;674 halfAxes_[1 + 2*i].absVal_ = ((float)mousePosition_[i])/1024 * mouseSensitivity_; 675 675 } 676 676 else … … 681 681 { 682 682 halfAxes_[0 + 2*i].hasChanged_ = true; 683 halfAxes_[0 + 2*i].absVal_ = ((float)mousePosition_[i])/1024 ;683 halfAxes_[0 + 2*i].absVal_ = ((float)mousePosition_[i])/1024 * mouseSensitivity_; 684 684 halfAxes_[1 + 2*i].absVal_ = 0.0f; 685 685 } 686 686 else 687 halfAxes_[1 + 2*i].absVal_ = -((float)mousePosition_[i])/1024 ;687 halfAxes_[1 + 2*i].absVal_ = -((float)mousePosition_[i])/1024 * mouseSensitivity_; 688 688 } 689 689 690 690 // relative 691 691 if (rel[i] > 0) 692 halfAxes_[0 + 2*i].relVal_ = ((float)rel[i])/1024 ;692 halfAxes_[0 + 2*i].relVal_ = ((float)rel[i])/1024 * mouseSensitivity_; 693 693 else 694 halfAxes_[1 + 2*i].relVal_ = -((float)rel[i])/1024 ;694 halfAxes_[1 + 2*i].relVal_ = -((float)rel[i])/1024 * mouseSensitivity_; 695 695 } 696 696 } … … 698 698 else 699 699 { 700 mouseRelative_[0] += rel_.x * mouseSensitivity_;701 mouseRelative_[1] -= rel_.y * mouseSensitivity_;700 mouseRelative_[0] += rel_.x; 701 mouseRelative_[1] -= rel_.y; 702 702 } 703 703 } -
code/branches/input/src/core/InputHandler.h
r1344 r1347 213 213 float deriveTime_; 214 214 215 // **** ConfigValues *****\\215 //##### ConfigValues ##### 216 216 //! Threshold for analog triggers until which the state is 0. 217 217 float analogThreshold_;
Note: See TracChangeset
for help on using the changeset viewer.