Skip to content

Input source codes fixes #7842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 18, 2025
Merged

Input source codes fixes #7842

merged 4 commits into from
Jul 18, 2025

Conversation

kpal81xd
Copy link
Contributor

  • Fixes range for KeyboardMouseSource key codes (was missing CTRL)
  • Refactored code length to be derived from readonly const

@kpal81xd kpal81xd self-assigned this Jul 18, 2025
@kpal81xd kpal81xd requested a review from Copilot July 18, 2025 15:41
@kpal81xd kpal81xd added the bug label Jul 18, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes input source code handling by correcting the key count range and refactoring hardcoded constants to be derived from readonly constant definitions. The changes ensure that the CTRL key code is properly included in the count and improve maintainability by eliminating magic numbers.

  • Fixed missing CTRL key in the key count calculation for KeyboardMouseSource
  • Refactored hardcoded array sizes to be derived from constant definitions
  • Applied consistent pattern across both keyboard-mouse and gamepad input sources

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/extras/input/sources/keyboard-mouse-source.js Moved key codes to top-level constant and derived KEY_COUNT from object length
src/extras/input/sources/gamepad-source.js Moved button codes to top-level constant and replaced hardcoded array sizes with BUTTON_COUNT

@kpal81xd kpal81xd merged commit 0d36ded into main Jul 18, 2025
7 checks passed
@kpal81xd kpal81xd deleted the input-source branch July 18, 2025 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants