A released stick can stay deflected while the game is unfocused, when it settles just past a noisy rest value
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 56/100
Direzione di ricerca
Start by reading the WinForms BackgroundInputFilter and SDL's SDL_PrivateJoystickShouldIgnoreEvent, then trace how each backend records an axis rest value and filters background input. Compare their handling of XInput readings near rest and the dead zone. Done means a released stick settles at rest while unfocused and both backends behave consistently.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Stride version
master (after #3803)
Platforms
Windows (XInput through the WinForms backend, and the SDL backend)
Graphics API
(leave empty)
What happens
While the game window has no focus, controller input follows SDL's rules (BackgroundInputFilter on the WinForms backend since #3803; SDL_PrivateJoystickShouldIgnoreEvent in SDL): an axis can only move towards its rest value, and the rest value is the first value read from the device.
XInput applies no dead zone, so that first value is a raw reading with some noise, not exactly 0. SDL's XInput driver also passes the raw values through (SDL_xinputjoystick.c). When a stick is released while the game is in the background and settles just past its rest value, on the other side from where it was pushed, that reading moves away from rest and is ignored, and so is every later reading on that side. The stick keeps its last accepted value, which can be far from centre, until the game has focus again. An unfocused game updates at 15 Hz by default (TreatNotFocusedLikeMinimized), so the last accepted value can be well away from centre, and a character can keep moving.
Expected: a released stick reads as at rest while the game is unfocused, on both backends.
Steps to reproduce
- Run a game on Windows with an XInput pad.
- Push a stick fully to one side, alt-tab away, then let the stick go.
- Depending on where it settles, the stick reads near its pushed value until focus returns, instead of near 0.
Log and callstack
None.
Screenshots and other details
Raised in the review of #3803. Accepting any value within XInput's dead zone of rest lets small movements through while unfocused, which SDL does not do. Settling values within the dead zone at the rest value would avoid both problems. It should be done for the WinForms and SDL backends together, so they keep the same behaviour.
- Lingua principale
- C#
- Stelle
- 8k
- Fork
- 1.2k
- Merge medio
- 2g 7h
- PR unite (30g)
- 316
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di stride3d/stride
-
`.gitignore` isn't created for sample projectsForse già presa @ferafiks l’ha presa 1 giorno fa. Apertaarea-Asset area-GameStudio area-Samples bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
area-Build bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
area-Samples enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stride3d/stride#3386 · 7 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
area-Physics bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
stride3d/stride#3384 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area-Samples bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
stride3d/stride#3066 · 6 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di stride3d/stride
Issue simili
-
Scaffold marks an association as required when its composite foreign key has a nullable columnApertaarea: scaffold status: needs-tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
provider:flagd type:fix
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
open-feature/dotnet-sdk-contrib#789 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
NimblePros/Metronome#23 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
jsboige/CoursIA#28504 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
CustomUnits: Battle Armor squads play tank movement sounds (move-audio default ignores FakeVehicle)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100