| 32 | } |
| 33 | |
| 34 | bool ShotStatsDefaultKey::keyPress(const BzfKeyEvent& key) { |
| 35 | // special keys to get out |
| 36 | switch (key.unicode) { |
| 37 | case 27: // escape |
| 38 | HUDDialogStack::get()->pop(); |
| 39 | return true; |
| 40 | case 13: // return |
| 41 | HUDDialogStack::get()->top()->execute(); |
| 42 | return true; |
| 43 | } |
| 44 | if (key.button == BzfKeyEvent::Home) { |
| 45 | HUDDialogStack::get()->pop(); |
| 46 | return true; |
| 47 | } |
| 48 | |
| 49 | // allow all commands to run |
| 50 | std::string keyCommand = KEYMGR.get(key, true); |
| 51 | if (keyCommand != "") { |
| 52 | CMDMGR.run(keyCommand); |
| 53 | return true; |
| 54 | } |
| 55 | |
| 56 | // all other keys return |
| 57 | HUDDialogStack::get()->pop(); |
| 58 | return true; |
| 59 | } |
| 60 | |
| 61 | bool ShotStatsDefaultKey::keyRelease(const BzfKeyEvent& /* key */) { |
| 62 | return true; |