Mahm00d
Mahm00d

Reputation: 3921

Delphi 2010: Form OnKeyDown, OnKeyPress or OnKeyUp doesn't work at all when using OpenGL!

I have a form and I've passed its handle to the OpenGL class to draw. I want to get keyboard commands from the user but it seems the procedures for getting the keys doesn't run (I've tested it). Although, I am using OnMouseDown with no problem at all.

Is there anything I am missing here? Anyone has a solution?

Upvotes: 1

Views: 1782

Answers (1)

Thomas
Thomas

Reputation: 181735

It's been ages since I used VCL (with C++Builder 3), but if it's still the same as in the old days, you might want to set KeyPreview on your form to True. That will cause the form to receive events that normally would only go to controls.

Upvotes: 2

Related Questions