sweetomy
V2EX  ›  macOS

swift 获取全局鼠标指针坐标

  •  
  •   sweetomy · Mar 22, 2015 · 5483 views
    This topic created in 4099 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   ·   5315 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 08:31 · PVG 16:31 · LAX 01:31 · JFK 04:31
    ♥ Do have faith in what you're doing.