...you would have to use the mouse down event to keep track of the last gadget selected ...
But MouseDown only works on canvases, so that wouldn't be feasible.
Similarly, I thought you might be able to wait for a GadgetAction event and then find out what gadget it came from, but apparently a change of focus does not qualify as a GadgetAction.