diff options
| author | jacob1 <jfu614@gmail.com> | 2013-07-27 15:19:02 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2013-07-27 15:19:02 (GMT) |
| commit | 3d16253319f7d461441a71946d3390b35001ddce (patch) | |
| tree | 0cfe9d0eaa782c4d3fb9f43dc0efc09a8762ee72 | |
| parent | 39acce4502bdfad7bb1d59cd3dcbe335e8b690a6 (diff) | |
| download | powder-3d16253319f7d461441a71946d3390b35001ddce.zip powder-3d16253319f7d461441a71946d3390b35001ddce.tar.gz | |
fix ctrl check in stamp and online browsers
| -rw-r--r-- | src/gui/localbrowser/LocalBrowserView.cpp | 9 | ||||
| -rw-r--r-- | src/gui/localbrowser/LocalBrowserView.h | 1 | ||||
| -rw-r--r-- | src/gui/search/SearchView.cpp | 9 | ||||
| -rw-r--r-- | src/gui/search/SearchView.h | 1 |
4 files changed, 16 insertions, 4 deletions
diff --git a/src/gui/localbrowser/LocalBrowserView.cpp b/src/gui/localbrowser/LocalBrowserView.cpp index a25c281..e1306dc 100644 --- a/src/gui/localbrowser/LocalBrowserView.cpp +++ b/src/gui/localbrowser/LocalBrowserView.cpp @@ -201,13 +201,18 @@ void LocalBrowserView::OnMouseWheel(int x, int y, int d) else c->PrevPage(); } + void LocalBrowserView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt) { if(key == KEY_ESCAPE) c->Exit(); - if (key == KEY_CTRL) + else if (key == KEY_CTRL) c->SetMoveToFront(false); - else +} + +void LocalBrowserView::OnKeyRelease(int key, Uint16 character, bool shift, bool ctrl, bool alt) +{ + if (key == KEY_CTRL) c->SetMoveToFront(true); } diff --git a/src/gui/localbrowser/LocalBrowserView.h b/src/gui/localbrowser/LocalBrowserView.h index 02aca28..85881cf 100644 --- a/src/gui/localbrowser/LocalBrowserView.h +++ b/src/gui/localbrowser/LocalBrowserView.h @@ -31,6 +31,7 @@ public: void NotifySelectedChanged(LocalBrowserModel * sender); virtual void OnMouseWheel(int x, int y, int d); 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(); }; diff --git a/src/gui/search/SearchView.cpp b/src/gui/search/SearchView.cpp index 662e756..a8d3d32 100644 --- a/src/gui/search/SearchView.cpp +++ b/src/gui/search/SearchView.cpp @@ -714,7 +714,12 @@ void SearchView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bo { if (key == KEY_ESCAPE) c->Exit(); - if (ctrl) - c->InstantOpen(ctrl); + if (key == KEY_CTRL) + c->InstantOpen(true); } +void SearchView::OnKeyRelease(int key, Uint16 character, bool shift, bool ctrl, bool alt) +{ + if (key == KEY_CTRL) + c->InstantOpen(false); +} diff --git a/src/gui/search/SearchView.h b/src/gui/search/SearchView.h index 5752a2c..4a68498 100644 --- a/src/gui/search/SearchView.h +++ b/src/gui/search/SearchView.h @@ -68,6 +68,7 @@ public: virtual void OnTick(float dt); virtual void OnMouseWheel(int x, int y, int d); 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); }; |
