Search Issue Tracker




Found in



Issue ID




[iOS] [MFI Controller] Input.GetButtonDown fires multiple times when holding down a button



Reproduction steps:
1. Connect a gamepad controller to an iOS device.
2. Open the attached " (17.4 KB)" project.
3. Build and run the "New Scene" to an iOS device.
4. Hold the "A" button and check the Xcode Console.

Actual behavior:
- Input.GetButtonDown is continuously returning True when the button is being held (number counts from 1 and increments by 1 (1, 2, 3, etc)) (Screenshot attached).

Expected behavior:
- Only 1 click is triggered on each button press.

Reproduced with:
iOS: 2018.3.0a8, 2019.2.0a7
iPhone 8+ iOS 11.0, iPhone 6S iOS 12.1.2

Not reproducible with:
iOS: 2017.4.0f1, 2018.2.21f1, 2018.3.0a6

Regression introduced in:
2018.3.0a7 (Build doesn't work on iOS) or 2018.3.0a8

The duplicate case was reproduced with GetKey, GetKeyDown, and GetKeyUp. Both cases are regressions, so this is most likely caused by the same root issue.

Comments (6)

  1. 80651af278f9e65776d6c9aefdc90da0?d=mm


    Mar 13, 2020 12:31

    The duplicate issue mentioned is NOT a duplicate of this, as the fix in the other issue only applies to tvOS devices, not iOS devices.

    Problem still exists for iOS devices ever since Unity 2018.3, upto and including 2019.3.5f1.

    Looking into in the generated Xcode project, the problem is related to the use of NSMutableSet* pressedButtons, which on each update in ResetAggregatedJoystickState() via UnityUpdateJoystickData() resets the button state of all buttons that were previously pressed) - therefore this will continuously keep refiring ButtonDown and ButtonUp for any button held down since each pressed button is getting forcibly reset again each time per update.

    The problem was "fixed" for tvOS by removing that collection's use when compiling for tvOS (by using a preprocessor define). If you do a similar change for iOS by just removing all use of pressedButtons altogether, then ButtonDown and ButtonUp appear to exhibit the correct behaviour on iOS once again.

    I'm quite honestly amazed the problem is still present in the latest stable 2019 release of Unity. One can only hope that someone will actually fix this proper in a future release.

  2. 9692446e33f6c2ac7a279c695b0c6060?d=mm


    Jul 16, 2019 20:26

    Same here! Apple TV 4th gen, Steelseries stratus xl, as well as the Siri Remote. Unity 2018.3.11f

  3. 03a73288430ce3c9bdbafbb354eb1de2?d=mm


    Jul 11, 2019 14:49

    We're experience a similar issue; selected UI buttons are being clicked repeatedly when holding a gamepad button to 'submit' via standalone input module.

  4. 10fca28b690117a6a427bf59208ca8d3?d=mm


    Jun 29, 2019 21:58

    I am still having this problem on Unity 2019.1.7, using Steelseries Nimbus controller with iPad Air 2. Would really like to get this fixed as fast as possible.

  5. 588e582e0e06e430231cb95652f2a2a2?d=mm


    May 19, 2019 18:19

    I'm having the same problem. Have spent weeks trying to fix it.

    Does anyone have a workaround.

    I'm also seeing the right stick returning duplicate values of the left stick which I cannot remove.

  6. 395c2b4d514d5449adec780734abd13f?d=mm


    Apr 30, 2019 09:17

    I have similar problem with Siri Remote on apple TV 4th gen. I map the touch area click (joystick 14) and play pause button (joystick 15) they call Input.GetButtonDown every frame it completely breaks my game. Any info from Unity ?

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.