Skip to content

Commit

Permalink
Fixed|Client|UI: Focused command line shouldn't let Tab keys pass thr…
Browse files Browse the repository at this point in the history
…ough
  • Loading branch information
skyjake committed Jun 29, 2013
1 parent e0ba69c commit 31731b4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
15 changes: 12 additions & 3 deletions doomsday/client/src/ui/widgets/consolecommandwidget.cpp
Expand Up @@ -115,10 +115,19 @@ bool ConsoleCommandWidget::handleEvent(Event const &event)
return true;
}

if(hasFocus() && event.isKeyDown())
if(hasFocus())
{
// Fall back to history navigation.
return d->history.handleControlKey(event.as<KeyEvent>().qtKey());
// All Tab keys are eaten by a focused console command widget.
if(event.isKey() && event.as<KeyEvent>().ddKey() == DDKEY_TAB)
{
return true;
}

if(event.isKeyDown())
{
// Fall back to history navigation.
return d->history.handleControlKey(event.as<KeyEvent>().qtKey());
}
}
return false;
}
1 change: 1 addition & 0 deletions doomsday/libdeng2/include/de/core/event.h
Expand Up @@ -53,6 +53,7 @@ class DENG2_PUBLIC Event
*/
int type() const { return _type; }

bool isKey() const { return _type == KeyPress || _type == KeyRepeat || _type == KeyRelease; }
bool isKeyDown() const { return _type == KeyPress || _type == KeyRepeat; }
bool isMouse() const { return _type == MouseButton || _type == MouseMotion ||
_type == MousePosition || _type == MouseWheel; }
Expand Down

0 comments on commit 31731b4

Please sign in to comment.