mouse event handler and viewport setting for smartphones/tablets