Skip to content
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

REPL incorrectly maps values for virtual keyboard on Windows #123572

Closed
picnixz opened this issue Sep 1, 2024 · 0 comments
Closed

REPL incorrectly maps values for virtual keyboard on Windows #123572

picnixz opened this issue Sep 1, 2024 · 0 comments
Labels
3.13 bugs and security fixes 3.14 new features, bugs and security fixes OS-windows stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@picnixz
Copy link
Contributor

picnixz commented Sep 1, 2024

Bug report

Bug description:

The VK_MAP in _pyrepl/windows_console is incorrectly specifying constants (https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes):

VK_MAP: dict[int, str] = {
    0x23: "end",  # VK_END
	...
    0x79: "f10",  # VK_F10
	...
    0x79: "f17",  # VK_F17  (DUPLICATED !!!)
    0x80: "f18",  # VK_F18  (should be 0x81)
    0x81: "f19",  # VK_F19	(should be 0x82)
    0x82: "f20",  # VK_F20	(should be 0x83)
}

I assume this is because of a wrong CC. The fix is easy (a feature would be to recognize F21 to F24 which are documented on https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes but I'll leave it to someone else).

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

@picnixz picnixz added the type-bug An unexpected behavior, bug, or error label Sep 1, 2024
@picnixz picnixz self-assigned this Sep 1, 2024
@picnixz picnixz added OS-windows stdlib Python modules in the Lib dir labels Sep 1, 2024
@picnixz picnixz removed their assignment Sep 2, 2024
@picnixz picnixz added 3.13 bugs and security fixes 3.14 new features, bugs and security fixes labels Sep 3, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Sep 3, 2024
pablogsal pushed a commit that referenced this issue Sep 3, 2024
…22692) (#123632)

gh-123572: Fix key codes in VK_MAP in windows_console.py (GH-122692)
(cherry picked from commit 782217f)

Co-authored-by: devdanzin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes 3.14 new features, bugs and security fixes OS-windows stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants