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

Method setKey

src/bzflag/KeyboardMapMenu.cpp:192–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192void KeyboardMapMenu::setKey(const BzfKeyEvent& event) {
193 if (editing == -1) {
194 return;
195 }
196 KeyKeyMap::iterator it;
197 for (it = mappable.begin(); it != mappable.end(); it++)
198 if (it->second.index == editing) {
199 break;
200 }
201 if ((KEYMGR.keyEventToString(event) == it->second.key1 && it->second.key2.empty())
202 || (KEYMGR.keyEventToString(event) == it->second.key2)) {
203 return;
204 }
205 ActionBinding::instance().associate(KEYMGR.keyEventToString(event),
206 it->first);
207 editing = -1;
208 update();
209}
210
211void KeyboardMapMenu::execute() {
212 const HUDuiControl* const _focus = getNav().get();

Callers 2

doKeyCommonFunction · 0.45
keyPressMethod · 0.45

Calls 6

updateFunction · 0.85
keyEventToStringMethod · 0.80
associateMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected