| 1513 | } |
| 1514 | |
| 1515 | bool GuiMenuTextListCtrl::onKeyDown(const GuiEvent &event) |
| 1516 | { |
| 1517 | //if the control is a dead end, don't process the input: |
| 1518 | if ( !mVisible || !mActive || !mAwake ) |
| 1519 | return false; |
| 1520 | |
| 1521 | //see if the key down is a <return> or not |
| 1522 | if ( event.modifier == 0 ) |
| 1523 | { |
| 1524 | if ( event.keyCode == KEY_RETURN ) |
| 1525 | { |
| 1526 | mMenuBarCtrl->closeMenu(); |
| 1527 | return true; |
| 1528 | } |
| 1529 | else if ( event.keyCode == KEY_ESCAPE ) |
| 1530 | { |
| 1531 | mSelectedCell.set( -1, -1 ); |
| 1532 | mMenuBarCtrl->closeMenu(); |
| 1533 | return true; |
| 1534 | } |
| 1535 | } |
| 1536 | |
| 1537 | //otherwise, pass the event to it's parent |
| 1538 | return Parent::onKeyDown(event); |
| 1539 | } |
| 1540 | |
| 1541 | void GuiMenuTextListCtrl::onMouseDown(const GuiEvent &event) |
| 1542 | { |