【发布时间】:2018-03-06 21:11:43
【问题描述】:
我目前正在我的 mouseDrag 函数中接收 nextEvent
while true {
guard let nextEvent = self.window?.nextEvent(matching: [.leftMouseDragged, .leftMouseUp, .rightMouseUp]) else {
continue
}
switch nextEvent.type {
case .leftMouseDragged:
self.cursorUpdate(with: nextEvent)
self.mouseDragged(with: nextEvent)
case .rightMouseUp:
continue
default:
self.mouseUp(with: nextEvent)
return
}
}
我只是想在此期间禁用右键单击。然而,通过这个实现,右键单击只是排队并在循环结束后被调用。
我将如何禁用正在注册的右键单击?
【问题讨论】:
-
你的代码在哪里执行?你能提供更多背景信息吗?
标签: swift macos appkit nsresponder