All pastes #95350 Raw Edit

Miscellany

public text v1 · immutable
#95350 ·published 2006-07-21 22:54 UTC
rendered paste body
using System;
using System.Collections;

using Gtk;

namespace LastExit
{
      public class PlayerWindow : Window {

<snip>

        private bool accel_group_active = true;

        private void OnKeyPressEvent(object o, KeyPressEventArgs args)
        {
            bool handled = false;
            if(PlayerWindow.Focus is Entry && Gtk.Global.CurrentEvent is Gdk.EventKey) {

                if(accel_group_active) {
                    PlayerWindow.RemoveAccelGroup(Globals.ActionManager.Ui.AccelGroup);
                    accel_group_active = false;
                } else {
                    if(!accel_group_active) {
                        PlayerWindow.AddAccelGroup(Globals.ActionManager.UI.AccelGroup);
                        accel_group_active = true;
                    }
                }

                switch(args.Event.Key) {
                    case Gdk.Key.n:
                    case Gdk.Key.N:
                        Driver.connection.Skip ();
                        handled = true;
                    break;
                }

                args.RetVal = handled;
            }
        }
    }
}