caret shifting for mouse click