X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;ds=sidebyside;f=plugins%2FVimish.cs;h=968fae901eff31a325468e02a88389e9db63b38a;hb=84890340eccbe66e303780a992fe152356974394;hp=3b4969f5c3937f3ebd785aa0cc8e995bd18b1faf;hpb=638aa976c61aff23d6394609ee840222aadaa423;p=WebThing.git diff --git a/plugins/Vimish.cs b/plugins/Vimish.cs index 3b4969f..968fae9 100644 --- a/plugins/Vimish.cs +++ b/plugins/Vimish.cs @@ -29,27 +29,6 @@ public class Vimish : WebThingPlugin { } private void Window_KeyPress(object o, KeyPressEventArgs e) { - switch(e.Event.Key) { - case Gdk.Key.o: - CommandStart("open "); - break; - case Gdk.Key.O: - CommandStart("open " + wt.WebView.MainFrame.Uri); - break; - case Gdk.Key.t: - CommandStart("tabopen "); - break; - case Gdk.Key.T: - CommandStart("tabopen " + wt.WebView.MainFrame.Uri); - break; - case Gdk.Key.colon: - CommandlineShow(); - break; - } - } - - private void WebView_KeyPress(object o, KeyPressEventArgs e) { - Console.WriteLine(e.Event.Key); if ((Gdk.ModifierType.ControlMask & e.Event.State) != 0) { switch(e.Event.Key) { case Gdk.Key.n: @@ -60,6 +39,31 @@ public class Vimish : WebThingPlugin { break; } } else { + switch(e.Event.Key) { + case Gdk.Key.o: + CommandStart("open "); + break; + case Gdk.Key.O: + CommandStart("open " + wt.WebView.MainFrame.Uri); + break; + case Gdk.Key.t: + CommandStart("tabopen "); + break; + case Gdk.Key.T: + CommandStart("tabopen " + wt.WebView.MainFrame.Uri); + break; + case Gdk.Key.colon: + CommandlineShow(); + break; + } + } + } + + private void WebView_KeyPress(object o, KeyPressEventArgs e) { + WebView wv = (WebView)o; + + Console.WriteLine(e.Event.Key); + if (e.Event.State == Gdk.ModifierType.None) { switch(e.Event.Key) { case Gdk.Key.j: wt.ScrolledWindow.Vadjustment.Value += wt.ScrolledWindow.Vadjustment.StepIncrement; @@ -74,10 +78,10 @@ public class Vimish : WebThingPlugin { wt.ScrolledWindow.Hadjustment.Value -= wt.ScrolledWindow.Hadjustment.StepIncrement; break; case Gdk.Key.r: - wt.WebView.Reload(); + wv.Reload(); break; case Gdk.Key.Escape: - wt.WebView.ExecuteScript("document.activeElement.blur()"); + wv.ExecuteScript("document.activeElement.blur()"); break; } }