I'm writing a program for the mac which draws the graphs of math functions. One event of the TMainmenu is Draw. When you click on Draw, a graph is drawn on a TImage. When the graph has completed, the focus is still on the Draw event of the TMainmenu, so that if the mouse hovers over one of the selections in the TMainmenu it is activated. If I press something like the Escape key, or a mouseclick, or do a showmessage, the focus leaves the TMainmenu and everything is fine.
So I just want to follow the Draw event with code to press the Escape key, but I'm not sure how to do that for the mac. LCLTypes is in my uses clause. I've tried VK_ESCAPE, KeyPress, etc, but I'm not doing something right.
Lazarus v1.2.6 carbon widgetset
FPC-2.6.4.intel-macosx
Macbook pro version 10.7.5 Intel Core i7