sweetomy
V2EX  ›  macOS

swift 获取全局鼠标指针坐标

  •  
  •   sweetomy · Mar 22, 2015 · 5591 views
    This topic created in 4137 days ago, the information mentioned may be changed or developed.
    import AppKit

    var point: NSPoint = NSEvent.mouseLocation()

    var test = "x: \(Float(point.x)) y: \(Float(point.y))"
    println(test)
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2850 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: ce1cc7fc · 39ms · UTC 04:39 · PVG 12:39 · LAX 21:39 · JFK 00:39
    ♥ Do have faith in what you're doing.