//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)); }
//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); }
//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); }
//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); }