[longomatch] Listen to key pressed in the main window
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Listen to key pressed in the main window
- Date: Tue, 28 Oct 2014 09:49:26 +0000 (UTC)
commit 6283918c33c6811d68f5271177703bda4389a882
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Sat Oct 18 04:14:13 2014 +0200
Listen to key pressed in the main window
LongoMatch.GUI/Gui/Component/AnalysisComponent.cs | 6 ------
LongoMatch.GUI/Gui/MainWindow.cs | 6 ++++++
2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/AnalysisComponent.cs
b/LongoMatch.GUI/Gui/Component/AnalysisComponent.cs
index e3440a0..c6369df 100644
--- a/LongoMatch.GUI/Gui/Component/AnalysisComponent.cs
+++ b/LongoMatch.GUI/Gui/Component/AnalysisComponent.cs
@@ -42,7 +42,6 @@ namespace LongoMatch.Gui.Component
this.Build ();
projectType = ProjectType.None;
detachedPlayer = false;
- ConnectSignals();
}
protected override void OnDestroyed ()
@@ -77,11 +76,6 @@ namespace LongoMatch.Gui.Component
codingwidget.DeletePlays (plays);
}
- private void ConnectSignals() {
- KeyPressEvent += (o, args) => (
- Config.EventsBroker.EmitKeyPressed(o, (int)args.Event.Key,
(int)args.Event.State));
- }
-
public void DetachPlayer ()
{
bool isPlaying = playercapturer.Playing;
diff --git a/LongoMatch.GUI/Gui/MainWindow.cs b/LongoMatch.GUI/Gui/MainWindow.cs
index bb1fcf8..c4e4e18 100644
--- a/LongoMatch.GUI/Gui/MainWindow.cs
+++ b/LongoMatch.GUI/Gui/MainWindow.cs
@@ -161,6 +161,12 @@ namespace LongoMatch.Gui
#region Private Methods
+ protected override bool OnKeyPressEvent (EventKey evnt)
+ {
+ Config.EventsBroker.EmitKeyPressed(this, (int)evnt.Key, (int)evnt.State);
+ return base.OnKeyPressEvent (evnt);
+ }
+
MenuItem ImportProjectActionMenu {
get {
return (MenuItem)
this.UIManager.GetWidget("/menubar1/FileAction/ImportProjectAction");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]