summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/localbrowser/LocalBrowserView.cpp9
-rw-r--r--src/gui/localbrowser/LocalBrowserView.h1
-rw-r--r--src/gui/search/SearchView.cpp9
-rw-r--r--src/gui/search/SearchView.h1
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);
};