首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Swift MacOS SpriteKit rightMouseDragged不工作

Swift MacOS SpriteKit rightMouseDragged不工作
EN

Stack Overflow用户
提问于 2019-03-21 04:27:10
回答 1查看 88关注 0票数 0

我有一个NSViewController/NSView,其中包含一个填充整个视图的SpriteKit场景。下面是我需要处理的事件:

代码语言:javascript
复制
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工作。

代码语言:javascript
复制
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。它不会在视图控制器或场景控制器中接收任何拖动事件。

EN

回答 1

Stack Overflow用户

发布于 2019-03-21 06:46:06

好吧,我不明白为什么,但是rightMouseDragged是被送到SKView的。因此,这里是我需要实现事件处理程序的地方:

代码语言:javascript
复制
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
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55269624

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档