<box on:mouseDown="onMouseDown();"/> function onMouseDown() { var eventObj = shell.currentEvent(); if (eventObj) { var frameY = eventObj.frameY; if (frameY >= 0) { // the mouse is below (or on) the top edge of the frame } else { // the mouse is above the top edge of the frame } } }