Пример #1
0
        //KEY DOWN event
        protected override bool OnKeyPressEvent(EventKey evnt)
        {
            GcKeyEventArgs args = new GcKeyEventArgs(this, evnt, suppress_key_press);

            if (KeyDown != null)
            {
                KeyDown(this, args);
                suppress_key_press = args.SuppressKeyPress;
                return(args.Handled);
            }
            return(base.OnKeyPressEvent(evnt));
        }
Пример #2
0
        //KEY UP event
        protected override bool OnKeyReleaseEvent(EventKey evnt)
        {
            GcKeyEventArgs args = new GcKeyEventArgs(this, evnt, suppress_key_press);

            if (KeyUp != null)
            {
                KeyUp(this, args);
                suppress_key_press = args.SuppressKeyPress;
                if (!suppress_key_press)
                {
                    //trigger the keypress event
                    if (KeyPressed != null)
                    {
                        KeyPressed(this, args);
                    }
                }
                suppress_key_press = false;
                return(args.Handled);
            }
            return(base.OnKeyReleaseEvent(evnt));
        }
 protected virtual void OnGtkcontrol1KeyPressed(object sender, HollyLibrary.GcKeyEventArgs args)
 {
     HollyLibrary.GcKeyEventArgs a = args;
     Console.WriteLine("Key down: " + a.KeyCode + " alt:" + a.Alt + " ctrl:" + a.Control + " shift:" + a.Shift);
 }
Пример #4
0
 //KEY UP event
 protected override bool OnKeyReleaseEvent(EventKey evnt)
 {
     GcKeyEventArgs args   = new GcKeyEventArgs( this, evnt, suppress_key_press );
     if( KeyUp != null )
     {
         KeyUp( this, args );
         suppress_key_press = args.SuppressKeyPress;
         if( !suppress_key_press )
         {
             //trigger the keypress event
             if( KeyPressed != null ) KeyPressed( this, args );
         }
         suppress_key_press = false;
         return args.Handled;
     }
     return base.OnKeyReleaseEvent (evnt);
 }
Пример #5
0
 //KEY DOWN event
 protected override bool OnKeyPressEvent(EventKey evnt)
 {
     GcKeyEventArgs args   = new GcKeyEventArgs( this, evnt, suppress_key_press );
     if( KeyDown != null )
     {
         KeyDown( this, args );
         suppress_key_press = args.SuppressKeyPress;
         return args.Handled;
     }
     return base.OnKeyPressEvent (evnt);
 }