Skip to content

Commit 782217f

Browse files
authored
pythongh-123572: Fix key codes in VK_MAP in windows_console.py (python#122692)
1 parent 6822cb2 commit 782217f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Lib/_pyrepl/windows_console.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def __init__(self, err: int | None, descr: str | None = None) -> None:
6363
if TYPE_CHECKING:
6464
from typing import IO
6565

66+
# Virtual-Key Codes: https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
6667
VK_MAP: dict[int, str] = {
6768
0x23: "end", # VK_END
6869
0x24: "home", # VK_HOME
@@ -87,10 +88,10 @@ def __init__(self, err: int | None, descr: str | None = None) -> None:
8788
0x7D: "f14", # VK_F14
8889
0x7E: "f15", # VK_F15
8990
0x7F: "f16", # VK_F16
90-
0x79: "f17", # VK_F17
91-
0x80: "f18", # VK_F18
92-
0x81: "f19", # VK_F19
93-
0x82: "f20", # VK_F20
91+
0x80: "f17", # VK_F17
92+
0x81: "f18", # VK_F18
93+
0x82: "f19", # VK_F19
94+
0x83: "f20", # VK_F20
9495
}
9596

9697
# Console escape codes: https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix key mappings for various F-keys in Windows for the new REPL. Patch by
2+
devdanzin

0 commit comments

Comments
 (0)