mouse and touch coordinates checking