X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=plugins%2FFFNav.cs;fp=plugins%2FFFNav.cs;h=588f432011231644483aca998cec1a3d575e15a1;hb=84890340eccbe66e303780a992fe152356974394;hp=4869c2f7903b4893611599269178a2f9aebb2958;hpb=638aa976c61aff23d6394609ee840222aadaa423;p=WebThing.git diff --git a/plugins/FFNav.cs b/plugins/FFNav.cs index 4869c2f..588f432 100644 --- a/plugins/FFNav.cs +++ b/plugins/FFNav.cs @@ -8,12 +8,28 @@ public class FFNav : WebThingPlugin { public override void Init(WebThing wt) { this.wt = wt; + + wt.Window.KeyPressEvent += Window_KeyPress; } public override void InitWebView(WebView wv) { wv.KeyPressEvent += WebView_KeyPress; } + private void Window_KeyPress(object o, KeyPressEventArgs e) { + if ((e.Event.State & Gdk.ModifierType.ControlMask) != 0) { + switch(e.Event.Key) { + case Gdk.Key.t: + wt.NewTab(); + wt.Tabs.CurrentPage = wt.Tabs.NPages - 1; + break; + case Gdk.Key.w: + wt.CloseTab(); + break; + } + } + } + private void WebView_KeyPress(object o, KeyPressEventArgs e) { WebView wv = (WebView) o; if ((e.Event.State & Gdk.ModifierType.Mod1Mask) != 0) { @@ -27,13 +43,6 @@ public class FFNav : WebThingPlugin { } } else if ((e.Event.State & Gdk.ModifierType.ControlMask) != 0) { switch(e.Event.Key) { - case Gdk.Key.t: - wt.NewTab(); - wt.Tabs.CurrentPage = wt.Tabs.NPages - 1; - break; - case Gdk.Key.w: - wt.CloseTab(); - break; case Gdk.Key.ISO_Left_Tab: if (wt.Tabs.CurrentPage == 0) wt.Tabs.CurrentPage = wt.Tabs.NPages - 1;