It does not select a random tool but the one under the cursor. If you keep the space bar pressed, move the cursor and then release the space bar. All menus in the Blender work in a similar way, you can select items without clicking.
2 Likes