From 25b84292bf3808d8fa4ab0797586d50009fcf978 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 28 Aug 2011 18:12:27 +0000 Subject: Moved ui::InputBox command completion into a seperate method instead of hardcoded to the tab key. --- src/ui/inputbox.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/ui/inputbox.cc') diff --git a/src/ui/inputbox.cc b/src/ui/inputbox.cc index 5656cb9..89e3243 100644 --- a/src/ui/inputbox.cc +++ b/src/ui/inputbox.cc @@ -142,15 +142,14 @@ void InputBox::draw() Paint::set_color(palette()->foreground()); } +void InputBox::complete() +{ + core::CommandBuffer::complete(input_text, input_pos); +} + bool InputBox::on_keypress(const int key, const unsigned int modifier) { switch (key) { - case SDLK_TAB: - // FIXME should not be here - core::CommandBuffer::complete(input_text, input_pos); - return true; - break; - case SDLK_HOME: input_pos = 0; return true; -- cgit v1.2.3