Created
April 10, 2021 06:28
-
-
Save Enchan1207/9bacb5f9fc48ba902b91543ff10f863c to your computer and use it in GitHub Desktop.
Swiftでマウスを動かす
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.swift | |
// MousemoveEx | |
// | |
// Created by EnchantCode on 2021/04/10. | |
// | |
import Foundation | |
import CoreGraphics | |
let mainDisplayID = CGMainDisplayID() | |
let destination: CGPoint = .init(x: 100, y: 100) | |
let result = CGDisplayMoveCursorToPoint(mainDisplayID, destination) | |
switch result{ | |
case .success: | |
print("success!") | |
default: | |
print("unknown: \(result)") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment