| 1755 | } |
| 1756 | |
| 1757 | bool CMapSettingsBackend::CContext::OnInput(const IInput::CEvent &Event) |
| 1758 | { |
| 1759 | if(!m_pLineInput) |
| 1760 | return false; |
| 1761 | |
| 1762 | if(!m_pLineInput->IsActive()) |
| 1763 | return false; |
| 1764 | |
| 1765 | if(Event.m_Flags & (IInput::FLAG_PRESS | IInput::FLAG_TEXT) && !m_pBackend->Input()->ModifierIsPressed() && !m_pBackend->Input()->AltIsPressed()) |
| 1766 | { |
| 1767 | // How to make this better? |
| 1768 | // This checks when we press any key that is not handled by the dropdown |
| 1769 | // When that's the case, it means we confirm the completion if we have a valid completion index |
| 1770 | if(Event.m_Key != KEY_TAB && Event.m_Key != KEY_LSHIFT && Event.m_Key != KEY_RSHIFT && Event.m_Key != KEY_UP && Event.m_Key != KEY_DOWN && !(Event.m_Key >= KEY_MOUSE_1 && Event.m_Key <= KEY_MOUSE_WHEEL_RIGHT)) |
| 1771 | { |
| 1772 | if(m_CurrentCompletionIndex != -1) |
| 1773 | { |
| 1774 | m_CurrentCompletionIndex = -1; |
| 1775 | m_DropdownContext.m_Selected = -1; |
| 1776 | Update(); |
| 1777 | UpdateCursor(true); |
| 1778 | } |
| 1779 | } |
| 1780 | } |
| 1781 | |
| 1782 | return false; |
| 1783 | } |
| 1784 | |
| 1785 | const char *CMapSettingsBackend::CContext::InputString() const |
| 1786 | { |
nothing calls this directly
no test coverage detected