Fix on selection manager

Correctly identify if mouse click and keydown was down on document
itself