| 229 | } |
| 230 | |
| 231 | bool HotKeyManager::onKeyEvent(bool _pressed, bool _shift, bool _control, MyGUI::KeyCode _key) |
| 232 | { |
| 233 | bool result = false; |
| 234 | |
| 235 | MapCommand::const_iterator section = mCommands.find(_key); |
| 236 | if (section == mCommands.end()) |
| 237 | return result; |
| 238 | |
| 239 | const VectorCommand& commands = (*section).second; |
| 240 | for (const auto& command : commands) |
| 241 | { |
| 242 | if (command.getPressed() == _pressed && command.getShift() == _shift && command.getControl() == _control) |
| 243 | { |
| 244 | if (CommandManager::getInstance().executeCommand(command.getCommand())) |
| 245 | result = true; |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | return result; |
| 250 | } |
| 251 | |
| 252 | } |
no test coverage detected