X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;ds=sidebyside;f=plugins%2FFFNav.cs;fp=plugins%2FFFNav.cs;h=1a3145c83b18db63fbfc54e51c1c3acda4e00041;hb=7bf09cef03c7fd78e599039b14a29e8a3f3eed42;hp=0000000000000000000000000000000000000000;hpb=126f2111e41f6b2595ffde1de6828ef12246e545;p=WebThing.git diff --git a/plugins/FFNav.cs b/plugins/FFNav.cs new file mode 100644 index 0000000..1a3145c --- /dev/null +++ b/plugins/FFNav.cs @@ -0,0 +1,31 @@ +using System; +using Gtk; +using bytex64.WebThing; + +public class Plugin { + WebThing wt; + + public Plugin(WebThing wt) { + this.wt = wt; + wt.WebView.KeyPressEvent += WebView_KeyPress; + } + + private void WebView_KeyPress(object o, KeyPressEventArgs e) { + if ((e.Event.State & Gdk.ModifierType.Mod1Mask) != 0) { + switch(e.Event.Key) { + case Gdk.Key.Left: + wt.WebView.GoBack(); + break; + case Gdk.Key.Right: + wt.WebView.GoForward(); + break; + } + } else { + switch(e.Event.Key) { + case Gdk.Key.BackSpace: + wt.WebView.GoBack(); + break; + } + } + } +}