protected override void OnPaint(PaintEventArgs paintEventArgs) { if (Focused) { glControl.Focus(); } // We have to make current the gl for the window we are. // If this throws an assert, you are calling MakeCurrent() before the glControl is done being constructed. // Call this function after you have called Show(). glControl.MakeCurrent(); if (CheckGlControl()) { base.OnPaint(paintEventArgs); } CheckGlControl(); }
// HACK: Huh!? Makes keyboard input work. https://github.com/opentk/GLControl/issues/18 protected override void OnShown(EventArgs e) { base.OnShown(e); glControl.Focus(); }