Getting the space key to act like the return key

I come from a Windows background and I have gotten into the habit of hitting the Space key every time there's a popup on my screen that I want to close. But on the Mac, it doesn't do anything, but hitting Return does. Does anyone know how I can get Mac to let the space key act like the Return key on modal dialogs? I tried to find something in the Keyboard preferences but don't see anything related to popups.


Press ctrl+F7 to enable Full Keyboard Access. This setting is also available in the System Preferences under the Keyboard preference pane:

enter image description here

By selecting 'All controls', you can tab around keyboard focus between the various widgets in dialog boxes, including buttons like OK or Cancel. It's slightly different from Windows, in that return is like pressing the fully highlighted button, while space is like pressing the selected / outlined button.

This image shows the difference between the two:

enter image description here

In this example, the Cancel button has focus (from tabbing) while OK is the default. So pressing space would select Cancel, while return would select OK.

And for completeness, this one can be accepted by either space or return:

enter image description here

It's worth noting that some OS X dialog boxes (I've noticed this especially with dialogs asking whether it's OK to overwrite a file) will come up with, for example, Don't Overwrite as the default for return, and Do Overwrite as the focused item for space. This makes it a single key either way to do what you want, but you need to be sure you've got the right one!