简体   繁体   English

iOS 15 DualSense 正在长按 PS 按钮打开 App Library

[英]iOS 15 DualSense is opening App Library on PS button long press

On iOS 15 a long press on the PS Button of the DualSense controller is opening the App Library and I don't receive a callback via the valueChangedHandler function.在 iOS 15 上,长按 DualSense controller 的 PS 按钮正在打开应用程序库,我没有通过 valueChangedHandler ZC1C425268E68385D1AB4ZZC17A94F 收到回调。 The App library which will be opened looks like this将要打开的 App 库是这样的应用程序库

This is how I handle all controller inputs:这就是我处理所有 controller 输入的方式:

func handleController(controller: GCController) {
    controller.extendedGamepad?.valueChangedHandler = { [weak self] (gamepad: GCExtendedGamepad, element: GCControllerElement) in
        guard let self = self else {
            return
        }
        // no feedback received when performing a long press on the PS button
}

Can the game library be suppressed somehow?游戏库可以以某种方式被压制吗? Sony's PS Remote Play app somehow manages to suppress it, but I don't know how, nor can I find anything in Apple's official API documentation.索尼的 PS Remote Play 应用程序以某种方式设法抑制它,但我不知道如何,也无法在 Apple 的官方 API 文档中找到任何内容。

Edit: Seems this problem only occurs on iPads, on iPhones this problem doesn't exist.编辑:似乎这个问题只发生在 iPad 上,在 iPhone 上这个问题不存在。 Is there some API or anything on iPads to suppress this behaviour? iPad 上是否有一些 API 或任何东西来抑制这种行为? I assume the most majority of users don't want to open the App Library in the middle of the game.我假设大多数用户不想在游戏中途打开应用程序库。

If someone ever faces the same problem you can actually disable system gestures for the Home button.如果有人遇到同样的问题,您实际上可以禁用 Home 按钮的系统手势。

In Swift all you have to add is this line (controller is a GCController object)在 Swift 中,您只需添加这一行(控制器是GCController对象)

controller.physicalInputProfile.buttons[GCInputButtonHome]?.preferredSystemGestureState = .disabled

In ObjectiveC it would work like this在ObjectiveC中它会像这样工作

controller.physicalInputProfile.buttons[GCInputButtonHome].preferredSystemGestureState = GCSystemGestureStateDisabled;

Thanks to the Apple employee who helped me here感谢在这里帮助我的 Apple 员工

https://developer.apple.com/forums/thread/711905?login=true https://developer.apple.com/forums/thread/711905?login=true

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM