test(input-mapper): add captureKey tests for all mapped keys #14294
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14294"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Bhupinder0x01 on 2026-11-01T06:59:29Z.
What
Add comprehensive test coverage for the captureKey function in capture.js, testing all letter keys, digit keys, numpad keys, function keys, and special keys that are mapped to SDL key names. Also tests error cases for composition/dead keys, non-exportable keys, and out-of-range keys.
Tested
Node.js tests pass (run with
node --test tests/*.test.jsin tools/input-mapper).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt fileImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T06:35:11Z.
Review: COMMENTED
Reviewed — no blocking findings
This adds JavaScript tests for
captureKey: the letters, digits, numpad, function, punctuation, navigation and modifier keys, and the rejection ofF25andNumpad10. I checked every expected value against the mapping incapture.jsand against thekeyNameslist inkeys.js, and the expectations match both. No test has run on this head: theBuildandInput mapperworkflow runs are waiting for maintainer approval (action_required).What I ran
29a01b1942c51d536910aeaeb6e8796d3c2f697b; baseb41526345185943c53af0c6eee97863df4389c9e. 1 file, +35:tools/input-mapper/tests/mapping.test.js(two new tests).captureKeyintools/input-mapper/capture.js, its rules for letters, digits, numpad digits, F1 to F24, and the mapping table. Read thekeyNameslist intools/input-mapper/keys.js.keyNames: all 101 are present. The rules give the same values as the test for every code the test lists. TheF25andNumpad10cases are rejected by the rules as the second test expects.BuildandInput mapperworkflow runs for this head areaction_required(they wait for approval). TheConventionsandPR labelsruns passed. No run ofnpm --prefix tools/input-mapper testexists for this head.Results
keyNamescaptureKeyF25andNumpad10take no matching rulenpm testfor this head;Input mapperis waiting for approvalBuildandInput mapperareaction_required;ConventionsandPR labelspassedRead-only check output
Precheck was not run: no PR-head code is run here. Diff check: passed. Conventions: passed. ABI audit: not applicable. Stack check: passed. Hosted:
gh api repos/boykopovar/AnyPS5/actions/runs?head_sha=29a01b1942c51d536910aeaeb6e8796d3c2f697b(theBuildandInput mapperruns areaction_required).Negative control
Not run here. A negative control needs a local run of the test, and the PR's JavaScript is not run here.
Findings
Blocking
None.
Non-blocking
None.
Sources
github.com/boykopovar/AnyPS5@29a01b1942/tools/input-mapper/tests/mapping.test.jsgithub.com/boykopovar/AnyPS5@29a01b1942/tools/input-mapper/capture.jsgithub.com/boykopovar/AnyPS5@29a01b1942/tools/input-mapper/keys.jsgithub.com/boykopovar/AnyPS5@29a01b1942/.github/workflows/input-mapper.ymlNot verified
npm testpasses on this head (it has not run).To get this to a good state
Input mapperrun so that the test runs on this head.