Something that's been bothering me with the Guild Wars 2 controls is that there seems to be no way to deselect a target if you have a target selected. From looking at the list of control bindings there doesn't appear to be any way to do that.
In Guild Wars 1 there's a target self that's bind to the f key by default that can serve this purpose. However, GW2 does not seem to have a target self in the list of key binds either.
Is there even a way to do this that doesn't involve killing the target?
For those wondering why I want to have to no target selected during combat, many of the skills work slightly differently if a target is selected. In particular, many of the skills will go in the general direction you 'point' at if no target is selected. However, if a target is selected then the skills will go towards that target instead.
Edit: To recap, this question is about how to quickly, efficiently, accurately and reliably deselect your current target even in the thick of battle. While I appreciate the answers given by others, they all fail to meet this requirement in some way.
For example, esc is too overloaded to be reliable. That key services duty as menu popup, closes open ingame dialog boxes, stops your character from auto-running and probably others I forgot about.
The 'target nearest ally' doesn't work if there's no ally nearby. Even if there are, they have to be within a certain radius and your camera has to be facing them.
Clicking on screen is unreliable. Think about doing this in a massive WvW battle where everything is a graphical clusterfuck. If you should need to retreat then a reliable way to deselect a target is a must.
Best Answer
Left-clicking on the ground is the most reliable way to deselect all targets.
ESC deselects any selected targets, but if nothing is selected you will bring up your menu (can be annoying mid-combat).
There is also a key binding to target the nearest ally, which will select yourself if no other allies are around. This is useful if you are having trouble finding a patch of ground to click on. This key is not assigned by default, so look for "Nearest Ally" under Targeting in Options->Controls.
You can also select the next closest target using TAB, in case you do actually want to direct your spells towards a different enemy then the one you current have selected. Then again, a left-click on the target works more reliably if multiple targets are in view.
There is also a Guild Wars 2 printable keyboard layout to help you visualize the default key bindings.