sweetomy
V2EX  ›  macOS

swift 获取全局鼠标指针坐标

  •  
  •   sweetomy · Mar 22, 2015 · 5597 views
    This topic created in 4139 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   ·   3505 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 11:04 · PVG 19:04 · LAX 04:04 · JFK 07:04
    ♥ Do have faith in what you're doing.