我有一个NSViewController/NSView,其中包含一个填充整个视图的SpriteKit场景。下面是我需要处理的事件:
override func mouseDown(with event: NSEvent) {
override func rightMouseDown(with event: NSEvent) {
override func otherMouseDown(with event: NSEvent) {
override func mouseDragged(with event: NSEvent) {
override func rightMouseDragged(with event: NSEvent) {
override func otherMouseDragged(with event: NSEvent) {
但是它们非常不一致,而且我根本不能让rightMouseDragged工作。
mouseDown works fine in the SKScene
rightMouseDown works fine in the SKScene
otherMouseDown had to be implemented in the viewController and passed on to the scene
mouseDragged worked fine in the SKScene
rightMouseDragged is not working at all
otherMouseDragged had to be implemented in the viewController and passed on to the scene
我的主要需求是修复rightMouseDragged。它不会在视图控制器或场景控制器中接收任何拖动事件。
发布于 2019-03-21 06:46:06
好吧,我不明白为什么,但是rightMouseDragged是被送到SKView的。因此,这里是我需要实现事件处理程序的地方:
mouseDown in the SKScene
rightMouseDown in the SKScene
otherMouseDown in the viewController and passed on to the scene
mouseDragged in the SKScene
rightMouseDragged in the SKView and be passed to the scene
otherMouseDragged in the viewController and passed on to the scene
https://stackoverflow.com/questions/55269624
复制相似问题