Skip to content

REPL incorrectly maps values for virtual keyboard on Windows #123572

Closed
@picnixz

Description

@picnixz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixesOS-windowsstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions