sweetomy
V2EX  ›  macOS

swift 获取全局鼠标指针坐标

  •  
  •   sweetomy · Mar 22, 2015 · 5493 views
    This topic created in 4102 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   ·   935 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 18:50 · PVG 02:50 · LAX 11:50 · JFK 14:50
    ♥ Do have faith in what you're doing.