Refactor accelerator key definitions in retropad.rc to remove control… #8
+12
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix: Keyboard accelerators (Ctrl+C, Ctrl+A, etc.) not working
Problem
The keyboard shortcuts like Ctrl+C, Ctrl+A, Ctrl+X, Ctrl+V were not functioning in the application.
Cause
The accelerator table in retropad.rc was using incorrect syntax. It combined ASCII notation ("^N") with VIRTKEY, CONTROL flags:
"^N", IDM_FILE_NEW, VIRTKEY, CONTROL // WRONG
The ^ prefix is ASCII shorthand that already means "Ctrl+", so "^N" means Ctrl+N in ASCII mode. But the VIRTKEY flag tells Windows to interpret the first parameter as a virtual key code, not an ASCII character — and "^N" is not a valid virtual key.
Fix
Remove the ^ prefix and use just the key letter with VIRTKEY, CONTROL:
"N", IDM_FILE_NEW, VIRTKEY, CONTROL // CORRECT
This properly tells Windows: "When the user presses the 'N' virtual key while holding Ctrl, trigger IDM_FILE_NEW."
Alternative (also valid)
You could also use pure ASCII notation without VIRTKEY:
"^N", IDM_FILE_NEW // Also correct (ASCII mode)
But the VIRTKEY approach is more common and handles edge cases better (e.g., keyboard layouts).