<box on:mouseDown="onMouseDown();"/> function onMouseDown() { var eventObj = shell.currentEvent(); if (eventObj) { var screenX = eventObj.screenX; if (screenX >= 0) { // the mouse is at the right side of (or on) the left edge of the screen } else { // the mouse is at the left side of the left edge of the screen } } }