Changeset 8351 for code/trunk/src/libraries/core/input
- Timestamp:
- Apr 28, 2011, 7:15:14 AM (14 years ago)
- Location:
- code/trunk/src/libraries/core/input
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/input/InputDevice.h
r7271 r8351 184 184 protected: 185 185 //! Common code for all button pressed events (updates pressed buttons list and calls the input states) 186 FORCEINLINE void buttonPressed(ButtonTypeParam button)186 ORX_FORCEINLINE void buttonPressed(ButtonTypeParam button) 187 187 { 188 188 // check whether the button already is in the list (can happen when focus was lost) … … 201 201 202 202 //! Common code for all button released events (updates pressed buttons list and calls the input states) 203 FORCEINLINE void buttonReleased(ButtonTypeParam button)203 ORX_FORCEINLINE void buttonReleased(ButtonTypeParam button) 204 204 { 205 205 // remove the button from the pressedButtons_ list -
code/trunk/src/libraries/core/input/InputManager.cc
r8079 r8351 151 151 assert(devices_.size() == InputDeviceEnumerator::FirstJoyStick); 152 152 153 typedef std::pair<std::string, std::string> StringPair; 154 153 155 // Fill parameter list 154 156 OIS::ParamList paramList; 155 157 size_t windowHnd = GraphicsManager::getInstance().getRenderWindowHandle(); 156 paramList.insert( std::make_pair("WINDOW", multi_cast<std::string>(windowHnd)));158 paramList.insert(StringPair("WINDOW", multi_cast<std::string>(windowHnd))); 157 159 #if defined(ORXONOX_PLATFORM_WINDOWS) 158 paramList.insert( std::make_pair("w32_keyboard", "DISCL_NONEXCLUSIVE"));159 paramList.insert( std::make_pair("w32_keyboard", "DISCL_FOREGROUND"));160 paramList.insert( std::make_pair("w32_mouse", "DISCL_FOREGROUND"));160 paramList.insert(StringPair("w32_keyboard", "DISCL_NONEXCLUSIVE")); 161 paramList.insert(StringPair("w32_keyboard", "DISCL_FOREGROUND")); 162 paramList.insert(StringPair("w32_mouse", "DISCL_FOREGROUND")); 161 163 if (exclusiveMouse_ == TriBool::True || GraphicsManager::getInstance().isFullScreen()) 162 164 { 163 165 // Disable Windows key plus special keys (like play, stop, next, etc.) 164 paramList.insert( std::make_pair("w32_keyboard", "DISCL_NOWINKEY"));165 paramList.insert( std::make_pair("w32_mouse", "DISCL_EXCLUSIVE"));166 } 167 else 168 paramList.insert( std::make_pair("w32_mouse", "DISCL_NONEXCLUSIVE"));166 paramList.insert(StringPair("w32_keyboard", "DISCL_NOWINKEY")); 167 paramList.insert(StringPair("w32_mouse", "DISCL_EXCLUSIVE")); 168 } 169 else 170 paramList.insert(StringPair("w32_mouse", "DISCL_NONEXCLUSIVE")); 169 171 #elif defined(ORXONOX_PLATFORM_LINUX) 170 172 // Enabling this is probably a bad idea, but whenever orxonox crashes, the setting stays on 171 173 // Trouble might be that the Pressed event occurs a bit too often... 172 paramList.insert( std::make_pair("XAutoRepeatOn", "true"));174 paramList.insert(StringPair("XAutoRepeatOn", "true")); 173 175 174 176 if (exclusiveMouse_ == TriBool::True || GraphicsManager::getInstance().isFullScreen()) 175 177 { 176 178 if (CommandLineParser::getValue("keyboard_no_grab").getBool()) 177 paramList.insert( std::make_pair("x11_keyboard_grab", "false"));179 paramList.insert(StringPair("x11_keyboard_grab", "false")); 178 180 else 179 paramList.insert( std::make_pair("x11_keyboard_grab", "true"));180 paramList.insert( std::make_pair("x11_mouse_grab", "true"));181 paramList.insert( std::make_pair("x11_mouse_hide", "true"));182 } 183 else 184 { 185 paramList.insert( std::make_pair("x11_keyboard_grab", "false"));186 paramList.insert( std::make_pair("x11_mouse_grab", "false"));187 paramList.insert( std::make_pair("x11_mouse_hide", "false"));181 paramList.insert(StringPair("x11_keyboard_grab", "true")); 182 paramList.insert(StringPair("x11_mouse_grab", "true")); 183 paramList.insert(StringPair("x11_mouse_hide", "true")); 184 } 185 else 186 { 187 paramList.insert(StringPair("x11_keyboard_grab", "false")); 188 paramList.insert(StringPair("x11_mouse_grab", "false")); 189 paramList.insert(StringPair("x11_mouse_hide", "false")); 188 190 } 189 191 #endif -
code/trunk/src/libraries/core/input/InputState.h
r7401 r8351 176 176 }; 177 177 178 FORCEINLINE void InputState::update(float dt)178 ORX_FORCEINLINE void InputState::update(float dt) 179 179 { 180 180 for (unsigned int i = 0; i < handlers_.size(); ++i) … … 183 183 } 184 184 185 FORCEINLINE void InputState::update(float dt, unsigned int device)185 ORX_FORCEINLINE void InputState::update(float dt, unsigned int device) 186 186 { 187 187 switch (device) … … 205 205 206 206 template <typename EventType, class ButtonTypeParam> 207 FORCEINLINE void InputState::buttonEvent(unsigned int device, ButtonTypeParam button)207 ORX_FORCEINLINE void InputState::buttonEvent(unsigned int device, ButtonTypeParam button) 208 208 { 209 209 assert(device < handlers_.size()); … … 216 216 } 217 217 218 FORCEINLINE void InputState::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)218 ORX_FORCEINLINE void InputState::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize) 219 219 { 220 220 if (handlers_[mouseIndex_s] != NULL) … … 222 222 } 223 223 224 FORCEINLINE void InputState::mouseScrolled(int abs, int rel)224 ORX_FORCEINLINE void InputState::mouseScrolled(int abs, int rel) 225 225 { 226 226 if (handlers_[mouseIndex_s] != NULL) … … 228 228 } 229 229 230 FORCEINLINE void InputState::joyStickAxisMoved(unsigned int device, unsigned int axis, float value)230 ORX_FORCEINLINE void InputState::joyStickAxisMoved(unsigned int device, unsigned int axis, float value) 231 231 { 232 232 assert(device < handlers_.size()); -
code/trunk/src/libraries/core/input/KeyBinder.cc
r8079 r8351 396 396 397 397 // iterate over all modes 398 for ( size_t mode_index = 0; mode_index < 3; ++mode_index)399 { 400 if (mode_index == (unsigned int)new_mode) // skip commands that are already in the desired mode398 for (int mode_index = 0; mode_index < 3; ++mode_index) 399 { 400 if (mode_index == new_mode) // skip commands that are already in the desired mode 401 401 continue; 402 402
Note: See TracChangeset
for help on using the changeset viewer.