Skip to content

HLE: keep GameInput readings consistent across types - #82

Merged
devin-ai-integration[bot] merged 1 commit into
mainfrom
devin/gameinput-readings
Nov 25, 2026
Merged

devin-ai-integration[bot] merged 1 commit into
mainfrom
devin/gameinput-readings

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Porta as upstream #2715, #2717 e #2718.
  • GetKeyState agora zera o slot seguinte quando o jogo reutiliza um buffer maior que a leitura, evitando teclas antigas aparentarem pressionadas.
  • Leituras de teclado passadas a GetGamepadState limpam o estado anterior em vez de deixar botões/triggers velhos.
  • Leituras de teclado preservam teclas seguradas na ordem original de pressão, mesmo quando a ordem de polling do host muda.
  • Pressões scriptadas sobrepostas não duplicam a mesma tecla nem a derrubam antes da última janela terminar.

Validation

  • cargo fmt --all -- --check
  • cargo run --locked --quiet --package xtask -- policy
  • CARGO_FEATURE_PURE=1 RUSTFLAGS='-D warnings' cargo check -p victory-hle --locked --target x86_64-pc-windows-msvc
  • CARGO_FEATURE_PURE=1 RUSTFLAGS='-D warnings' cargo clippy -p victory-hle --all-targets --locked --target x86_64-pc-windows-msvc

Sem validação real de jogo/GPU/Proton nesta VM.


Devin Review

Co-authored-by: VlREX <VlREX@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

Comment on lines +1097 to +1100
if n < count as usize {
// SAFETY: the slot after the last key is inside the caller's array.
unsafe { out.add(n).write(KeyState::default()) };
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Reused buffers retain keys past the terminator

key_state leaves later slots untouched. The two-slot test does not cover them. Verify that the title stops at the first zero after releasing several keys together.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A terminador único é intencional: a referência de GetKeyState usa scan code e virtual key zero para marcar o fim das teclas válidas quando há espaço. Consumidores conformes param no primeiro zero; slots depois dele não fazem parte da leitura. O teste cobre especificamente buffer reutilizado com espaço sobrando.

@devin-ai-integration
devin-ai-integration Bot merged commit 2bd74d5 into main Nov 25, 2026
5 checks passed
@devin-ai-integration
devin-ai-integration Bot deleted the devin/gameinput-readings branch November 25, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant