Re-tabinated C# files
[WebThing.git] / plugins / FFNav.cs
1 using System;
2 using Gtk;
3 using bytex64.WebThing;
4
5 public class Plugin {
6     WebThing wt;
7
8     public Plugin(WebThing wt) {
9         this.wt = wt;
10         wt.WebView.KeyPressEvent += WebView_KeyPress;
11     }
12
13     private void WebView_KeyPress(object o, KeyPressEventArgs e) {
14         if ((e.Event.State & Gdk.ModifierType.Mod1Mask) != 0) {
15             switch(e.Event.Key) {
16             case Gdk.Key.Left:
17                 wt.WebView.GoBack();
18                 break;
19             case Gdk.Key.Right:
20                 wt.WebView.GoForward();
21                 break;
22             }
23         } else {
24             switch(e.Event.Key) {
25             case Gdk.Key.BackSpace:
26                 wt.WebView.GoBack();
27                 break;
28             }
29         }
30     }
31 }