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

--
_______________________________________________
lazarus mailing list
[email protected]
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to