From 3d16253319f7d461441a71946d3390b35001ddce Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sat, 27 Jul 2013 11:19:02 -0400 Subject: [PATCH] fix ctrl check in stamp and online browsers --- src/gui/localbrowser/LocalBrowserView.cpp | 9 +++++++-- src/gui/localbrowser/LocalBrowserView.h | 1 + src/gui/search/SearchView.cpp | 9 +++++++-- 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 a25c281f9..e1306dcb0 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 02aca2833..85881cfaa 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 662e756e5..a8d3d326f 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 5752a2ce3..4a684985a 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); };