Here, “Photoshop CC 2014” installed on “Mac OS X Yosemite” is used.

Photoshop - Brush Tool - Create dotted and dashed lines

Photoshop - Brush Tool - Change the shape of the tip (such as a square)