Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2019-04

TApplication.DoEscapeKey/DoReturnKey

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Zoë Peterson

I'm working on the keyboard handling code in the Cocoa widgetset and I've run into an issue I'm hoping for some guidance on.

TApplication's DoEscapeKey and DoEnterKey are called in response to LM_KEYUP rather than LM_KEYDOWN. Cocoa's "invalid key" beep occurs as part of the keyDown processing though and can not be suppressed until after keyUp (long story). The logic in DoReturnKey to actually get to the "Key := VK_UNKNOWN" line is very complicated, and I don't want to to repeat all of it in the keyDown handler just to suppress the beep.

Is there a simpler check to do, or can all of those checks be moved into accessor methods that return ActiveDefaultControl/CancelControl or nil based on whether they should be activate?

Zoë Peterson Scooter Software

Reply by email