fun handleEvent()

in sample/src/main/kotlin/org/jetbrains/desktop/sample/macos/SkikoSampleMac.kt [83:110]


    fun handleEvent(event: Event): EventHandlerResult {
        return when (event) {
            is Event.MouseDown -> {
                if (isPointInSquare(event.locationInWindow)) {
                    currentColorIndex = (currentColorIndex + 1) % colors.size
                    totalClicks++
                    Logger.info { "Square clicked $totalClicks times total" }
                    EventHandlerResult.Stop
                } else if (event.locationInWindow.x > origin.x &&
                    event.locationInWindow.x < origin.x + size.width * 0.75 &&
                    event.locationInWindow.y > origin.y &&
                    event.locationInWindow.y < origin.y + size.height
                ) {
                    if (event.clickCount == 1L) {
                        startWindowDrag?.invoke()
                    } else {
                        zoomBoxClicked?.invoke()
                    }

                    EventHandlerResult.Stop
                } else {
                    EventHandlerResult.Continue
                }
            }

            else -> EventHandlerResult.Continue
        }
    }