Changeset 9978 for code/trunk/src/libraries/core/input/Button.cc
- Timestamp:
- Jan 4, 2014, 9:48:04 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/input/Button.cc
r9667 r9978 138 138 else if (token == "onrelease") 139 139 mode = KeybindMode::OnRelease; 140 else if (token == "onpressandrelease") 141 mode = KeybindMode::OnPressAndRelease; 140 142 else if (token == "onhold") 141 143 mode = KeybindMode::OnHold; … … 216 218 { 217 219 mode = eval.getConsoleCommand()->getKeybindMode(); 218 commands[mode].push_back(cmd);220 this->addCommand(cmd, mode, commands); 219 221 } 220 222 } … … 232 234 cmd->setFixedKeybindMode(true); 233 235 234 commands[mode].push_back(cmd);236 this->addCommand(cmd, mode, commands); 235 237 } 236 238 } … … 251 253 } 252 254 255 inline void Button::addCommand(BaseCommand* cmd, KeybindMode::Value mode, std::vector<BaseCommand*> commands[3]) 256 { 257 if (mode == KeybindMode::OnPressAndRelease) 258 { 259 BaseCommand* cmd2 = cmd->clone(); 260 261 commands[KeybindMode::OnPress].push_back(cmd); 262 commands[KeybindMode::OnRelease].push_back(cmd2); // clone 263 } 264 else 265 commands[mode].push_back(cmd); 266 } 267 253 268 inline void Button::parseError(const std::string& message, bool serious) 254 269 {
Note: See TracChangeset
for help on using the changeset viewer.