Programmatically disable shake to find

冷暖自知 提交于 2019-12-10 22:28:06

问题


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.

How can I get around this problem?


回答1:


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()
}


来源:https://stackoverflow.com/questions/53302581/programmatically-disable-shake-to-find

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!