MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / getKeysFromCommand

Method getKeysFromCommand

src/common/KeyManager.cpp:240–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238
239
240std::vector<std::string> KeyManager::getKeysFromCommand(std::string command, bool press) const {
241 std::vector<std::string> keys;
242 EventToCommandMap::const_iterator index;
243 if (press) {
244 for (index = pressEventToCommand.begin(); index != pressEventToCommand.end(); ++index) {
245 if (index->second == command) {
246 keys.push_back(this->keyEventToString(index->first));
247 }
248 }
249 }
250 else {
251 for (index = releaseEventToCommand.begin(); index != releaseEventToCommand.end(); ++index) {
252 if (index->second == command) {
253 keys.push_back(this->keyEventToString(index->first));
254 }
255 }
256 }
257 return keys;
258}
259
260
261std::string KeyManager::keyEventToString(

Callers 8

warnAboutMainFlagsFunction · 0.80
warnAboutRadarFlagsFunction · 0.80
warnAboutRadarFunction · 0.80
warnAboutConsoleFunction · 0.80
warnAboutSlowMotionFunction · 0.80
notifyBzfKeyMapChangedFunction · 0.80
GetKeyBindingsMethod · 0.80
GetCmdToKeysMethod · 0.80

Calls 4

keyEventToStringMethod · 0.95
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected