InputSystem icon indicating copy to clipboard operation
InputSystem copied to clipboard

2D Vector Composite doesn't perform on every button press

Open XelfXendr opened this issue 7 years ago • 4 comments

I need a 2d vector composite bound to arrow keys that performs every time a button is pressed without caring about button releases. I thought that'd be easily achieved by giving each of the 4 button bindings a Press Only interaction but that led to unusual behaviour. Example:

  • Pressing and holding the up arrow key activates .performed, and then pressing the left arrow key while still holding the up arrow key also activates .performed. But any other presses while holding those two buttons don't do anything.
  • The second time you try doing the same: Pressing and holding the up arrow key activates .performed, but pressing the left arrow while still holding the up arrow does nothing.

And the last thing, having the bindings set this way, .started and .canceled don't get triggered, which is possibly also by design but I think it's worth pointing out.

XelfXendr avatar May 21 '19 09:05 XelfXendr

@XelfXendr Would you be able to attach a minimal repro project to demonstrate the issue? Also, you may get more help in the forum for a solution: https://forum.unity.com/forums/new-input-system.103/

JiaUnity avatar May 23 '19 21:05 JiaUnity

Unity version: 2019.3.0a2 InputSystem version: 0.2.10-preview Small project repo: https://github.com/XelfXendr/InputTest

Try using WASD to change the position of the green knob.

Stuff is probably working as intended and I probably misunderstand how it's supposed to be working. Since the behaviour doesn't match my expectations, I thought I'd let you know.

My expectation: .performed being called whenever a button is pressed, no matter if some are already pressed. Reality: .performed being called when a button is pressed and no other is currently being pressed (with weird exceptions)

I already found a solution for my problem, so I don't need help anymore.

XelfXendr avatar May 24 '19 12:05 XelfXendr

A legit bug imo. Just couldn't decide before seeing the project.

When using Press Interaction, Cancelled is never triggered because it means the Action failed. For example, an Action is Performed when user clicks LMB 4 times in a row. If the user only clicks 3 times, Cancelled would be triggered, for the Action fails to be carried out. When using Press Interaction, Started is only triggered when it is set to Release Only, and it happens when the key is pressed. For Press Only and Press and Release, Performed is the only one fired when pressing down. I'd say using Press and Release paired with Performed would achieve what you have in mind (I think?). However it doesn't, thus a bug.

Filed: https://issuetracker.unity3d.com/product/unity/issues/guid/1162962/ Closing.

JiaUnity avatar Jun 15 '19 01:06 JiaUnity

I have a very similar issue on the linux version of unity 2020.1.8f1. The windows version shows no such problems...

ynotzort avatar Oct 12 '20 10:10 ynotzort