Programatically disable shake to find

2019-07-21 14:11发布

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条回答
叼着烟拽天下
2楼-- · 2019-07-21 14:50

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()
}
登录 后发表回答