本文介绍了以编程方式禁用摇动以查找的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Mac OS El Capitan引入了一个称为"摇动鼠标指针来定位"-似乎忽略了CGDisplayHideCursor/CGDisplayShowCursor

Mac os El Capitan introduced a feature called "Shake mouse pointer to locate" - it seems to ignore the cursor visibility set by CGDisplayHideCursor / CGDisplayShowCursor

我需要完全隐藏跨平台第一人称游戏的鼠标光标.

I need to completely hide the mouse cursor for my cross platform first person game.

如何解决这个问题?

推荐答案

根据我的经验,没有系统事件可以处理此问题.它不是最漂亮的,但是您可以按照此博客文章中的建议进行操作,然后隐藏光标在监听mouseMove事件时.

No system event to handle this in my experience. It's not the prettiest, but you can follow the advice in this blogpost and rehide the cursors when listening to the mouseMove event.

override func mouseMoved(with event: NSEvent) {
    NSCursor.hide()
}

这篇关于以编程方式禁用摇动以查找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 12:41