fix ctrl check in stamp and online browsers

This commit is contained in:
jacob1 2013-07-27 11:19:02 -04:00
parent 39acce4502
commit 3d16253319
4 changed files with 16 additions and 4 deletions

View File

@ -201,13 +201,18 @@ void LocalBrowserView::OnMouseWheel(int x, int y, int d)
else else
c->PrevPage(); c->PrevPage();
} }
void LocalBrowserView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt) void LocalBrowserView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt)
{ {
if(key == KEY_ESCAPE) if(key == KEY_ESCAPE)
c->Exit(); c->Exit();
if (key == KEY_CTRL) else if (key == KEY_CTRL)
c->SetMoveToFront(false); c->SetMoveToFront(false);
else }
void LocalBrowserView::OnKeyRelease(int key, Uint16 character, bool shift, bool ctrl, bool alt)
{
if (key == KEY_CTRL)
c->SetMoveToFront(true); c->SetMoveToFront(true);
} }

View File

@ -31,6 +31,7 @@ public:
void NotifySelectedChanged(LocalBrowserModel * sender); void NotifySelectedChanged(LocalBrowserModel * sender);
virtual void OnMouseWheel(int x, int y, int d); virtual void OnMouseWheel(int x, int y, int d);
virtual void OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt); virtual void OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt);
virtual void OnKeyRelease(int key, Uint16 character, bool shift, bool ctrl, bool alt);
virtual ~LocalBrowserView(); virtual ~LocalBrowserView();
}; };

View File

@ -714,7 +714,12 @@ void SearchView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bo
{ {
if (key == KEY_ESCAPE) if (key == KEY_ESCAPE)
c->Exit(); c->Exit();
if (ctrl) if (key == KEY_CTRL)
c->InstantOpen(ctrl); c->InstantOpen(true);
} }
void SearchView::OnKeyRelease(int key, Uint16 character, bool shift, bool ctrl, bool alt)
{
if (key == KEY_CTRL)
c->InstantOpen(false);
}

View File

@ -68,6 +68,7 @@ public:
virtual void OnTick(float dt); virtual void OnTick(float dt);
virtual void OnMouseWheel(int x, int y, int d); virtual void OnMouseWheel(int x, int y, int d);
virtual void OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt); virtual void OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt);
virtual void OnKeyRelease(int key, Uint16 character, bool shift, bool ctrl, bool alt);
}; };