casanovaC4's picture

Arrow Keys Do Not Trigger KeyDown Event On GLControl . . . . . . .


I have a Form which adds a GLControl for display.
After adding GLControl to the Form the arrow keys(up, down, left, right) does not raise the KeyDown event but all the rest of the keys do, Form's KeyPreview is set to true.
I tried using GLControl's KeyDown event but same result, no arrow keys fire the event.
If GLControl is not added to the Form arrow keys raise events just fine but not when GLControl is added.
There something wrong with GLControl's own key events which messes with the Form's key events too.

Another thing, KeyUp event works properly with GLControl and with Form after adding GLControl to it.

Do i have to use OpenTK's keyboard library as an alternative? and if yes then how can i integrate OpenTK keyboard with the GLControl KeyEvents or the Form?


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

GLControl doesn't interact with or impede the KeyDown event in any way - or at least, it shouldn't!

Can you test with an empty UserControl and see if the KeyDown events fire as expected? If they do, please file a bug and so we can take a look. A short test case that demonstrates the issue is especially welcome.

There is no way to use OpenTK's KeyboardDevice with Windows.Forms at this point (we are working on this).

casanovaC4's picture

The problem is about the Arrow Keys other keys do their job as expected in KeyDown Event.
If GLControl does not or should not fire KeyDown Event then why the KeyUp Event works?

Another big problem is when a GLControl is added to a Form it starts doing the same to Form's KeyDown Event(Arrow Keys Problem) while KeyUp Event here remains unaffected.

If you think it is a bug, i'll file a problem.
Thank you for hearing, again.


the Fiddler's picture

Does a regular UserControl exhibit the same behavior as GLControl? If no, please file a bug!

ebnf's picture