V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
sweetomy
V2EX  ›  macOS

swift 获取全局鼠标指针坐标

  •  
  •   sweetomy · Mar 22, 2015 · 5389 views
    This topic created in 4058 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   ·   2482 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 07:14 · PVG 15:14 · LAX 00:14 · JFK 03:14
    ♥ Do have faith in what you're doing.