Thanks for the reply Wiebo. Keydown() and $101 events get processed by the activated gadget so that won't work unless the main window is the active gadget.
The kludge is to refocus after a 401 event but this isn't foolproof - pressing a button and moving the mouse away before mouse up will activate the gadget but not trigger an event.
The kludge is to refocus after a 401 event but this isn't foolproof - pressing a button and moving the mouse away before mouse up will activate the gadget but not trigger an event.