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

Method keyPress

src/bzflag/MenuDefaultKey.cpp:35–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35bool MenuDefaultKey::keyPress(const BzfKeyEvent& key) {
36 switch (key.unicode) {
37 case 27: // escape
38 SOUNDSYSTEM.play(SFX_DROP_FLAG, NULL, false, true);
39 HUDDialogStack::get()->pop();
40 return true;
41
42 case 13: // return
43 SOUNDSYSTEM.play(SFX_GRAB_FLAG, NULL, false, true);
44 HUDDialogStack::get()->top()->execute();
45 return true;
46 }
47
48 if (KEYMGR.get(key, true) == "quit") {
49 CommandsStandard::quit();
50 return true;
51 }
52
53 return false;
54}
55
56bool MenuDefaultKey::keyRelease(const BzfKeyEvent& key) {
57 switch (key.unicode) {

Callers

nothing calls this directly

Calls 5

popMethod · 0.80
topMethod · 0.80
playMethod · 0.45
executeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected