Unity-Technologies / InputSystem

An efficient and versatile input system for Unity.
Other
1.43k stars 310 forks source link

FIX: Avoid cases on Android where keys can get stuck set as pressed (ISXB-475). #1896

Closed graham-huws closed 6 months ago

graham-huws commented 7 months ago

Description

Original bug reproduction - open linked project (in ISXB-475) and build for Android, connecting a physical keyboard (either bluetooth or USB) to the Android device. Hold the W key for about a second then let go. After several attempts the app will say that the W key is pressed, even though it isn't. For me (Pixel 7 Pro) this usually reproduces by the time the counter gets to about ~3000, but definitely usually happens within a few minutes.

Changes made

See comment added to the code. I don't know the area well enough to expect any negative effects, but the change certainly seems to fix the issue!

Checklist

Before review:

During merge:

Pauliusd01 commented 6 months ago

I tried this and the testing phone I have at home does not pick up my keyboard (either via usb dock or bluetooth) Maybe @stefanunity could help QA this

stefanunity commented 6 months ago

I can't repro the issue on my Pixel 8a neither on the old unifixed Input System nor on the PR version using my MS Natural Keyboard :(

Pauliusd01 commented 6 months ago

Added area QA - @IGuscin

Pauliusd01 commented 6 months ago

Requested help from the filing CQA

Pauliusd01 commented 6 months ago

From CQA: "I tested this on 2023.2.17f1 with 1.7.0f1 input system - and it repro'd. Then I added the package from this PR and tried to repro again until the timer hit 6000 which it didn't repro even once. Checked with this device: VLNQA00267, Samsung Galaxy S10+ (SM-G975F), Android 12, CPU: Exynos 9 (9820), GPU: Mali-G76"