To swerve correctly:
Shift your weight quickly.
Turn the handlebars quickly.
Press the handgrip in the direction of the turn.
Press the handgrip in the direction opposite of the turn.
To execute a swerve, press the handgrip on the side of your desired turn. Press on the opposite handgrip to return to your original direction after you are clear of the hazard.