I can even give you 3 solutions.
1)
if (event.type == sf::Event::MouseButtonPressed)
{
if (button->mouseOnObject(event.mouseButton.x, event.mouseButton.y) == false)
{
// The click did not occur on the button
}
}
Like this you can find out when you clicked on the button or not.
The only problem is that you will have to manually check every object.
2)
You want to find out if the mouse went down next to my widgets, so on something else.
You could make that 'something else' a custom tgui widget so that it can make use of the EventManager in tgui?
3)
Another solution to your problem could be to put a Picture behind all tgui objects (the Empty.png image from my Form Builder).
Then you ask me to implement a mouseDown event for Picture as well.
And when the Picture gives you a mouseDown callback you will know that the mouse didn't went down on any other tgui object.
TextBox also has keyboard events.