look at eventhooks http://www.2dgamecreators.com/maxgui/T15-Eventhooks.html.
The thread where Mark responded to this issue: http://www.blitzmax.com/Community/posts.php?topic=53158
The thread where Mark responded to this issue: http://www.blitzmax.com/Community/posts.php?topic=53158