Custom Event Handlers

HC GUI programming Custom Event Handlers
GUI programming OnChar

Custom Event Handlers

...are "short" Logo routines which are executed when a specific event is raised, i.e. a keystroke or a mouse click.

"short" means here short in execution time relative to the number of events per second. If there are many events in one second, as it can be with mouse events, then your custom event handler shouldn't block, and at least it should stop at some time, it should terminate.

If there are more events generated than could be processed, eventually a fatal stack overflow will occure and Logo will crash.

For the console are the following keyboard and mouse handlers:

OnChar OnKeyDown OnKeyUp KeyboardValue OnTextMouseLeftDown OnTextMouseRightDown OnTextMouseMiddleDown OnTextMouseLeftUp OnTextMouseRightUp OnTextMouseMiddleUp OnTextMouseLeftDClick OnTextMouseRightDClick OnTextMouseMiddleDClick OnTextMouseMotion

For the main graph window are those mouse handlers:

OnMouseLeftDown OnMouseRightDown OnMouseMiddleDown OnMouseLeftUp OnMouseRightUp OnMouseMiddleUp OnMouseLeftDClick OnMouseRightDClick OnMouseMiddleDClick OnMouseMotion

The event handlers are presented in the example eventtest.lg.

Custom Event Handlers

Reference:

GUI programming OnChar