There’s a secret gesture you can use with Mac multitouch trackpads that lets you double-tap with four fingers to switch back to the most recently used desktop space in OS X Lion (although not previous versions of OS X).
For example, should you switch to the Dashboard space from the main desktop, double-tapping in this way will switch back to the desktop. Note that this gesture involves merely tapping on the trackpad, and not clicking. This remains true even if you have Tap to Click turned off in System Preferences.
To activate the gesture, you’ll need to use a hidden setting. Open a Terminal window (Finder->Applications->Utilities->Terminal) and type the following:
defaults write com.apple.dock double-tap-jump-back -bool TRUE;killall Dock
The changes should take effect right away, so give it a try. Like all gestures, it takes a little practice. Note that it appears that after a minute or two, OS X “forgets” the previous desktop space, so double-tapping to switch a space will no longer work until you again switch to a different space.
To turn off this new gesture, open a Terminal window and type the following:
defaults delete com.apple.dock double-tap-jump-back;killall DockRelated