]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-123572: Fix key codes in VK_MAP in windows_console.py (GH-122692) (#123632)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 3 Sep 2024 14:01:14 +0000 (16:01 +0200)
committerGitHub <noreply@github.com>
Tue, 3 Sep 2024 14:01:14 +0000 (15:01 +0100)
gh-123572: Fix key codes in VK_MAP in windows_console.py (GH-122692)
(cherry picked from commit 782217f28f0d67916fc3ff82b03b88573686c0e7)

Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
Lib/_pyrepl/windows_console.py
Misc/NEWS.d/next/Core_and_Builtins/2024-09-03-13-34-35.gh-issue-123572.uuqoYV.rst [new file with mode: 0644]

index ba9af36b8be99c364a9702ea5d61346aca4f192a..14a426ba8a475c6456d892e088534f8c00a5a8cb 100644 (file)
@@ -63,6 +63,7 @@ TYPE_CHECKING = False
 if TYPE_CHECKING:
     from typing import IO
 
+# Virtual-Key Codes: https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
 VK_MAP: dict[int, str] = {
     0x23: "end",  # VK_END
     0x24: "home",  # VK_HOME
@@ -87,10 +88,10 @@ VK_MAP: dict[int, str] = {
     0x7D: "f14",  # VK_F14
     0x7E: "f15",  # VK_F15
     0x7F: "f16",  # VK_F16
-    0x79: "f17",  # VK_F17
-    0x80: "f18",  # VK_F18
-    0x81: "f19",  # VK_F19
-    0x82: "f20",  # VK_F20
+    0x80: "f17",  # VK_F17
+    0x81: "f18",  # VK_F18
+    0x82: "f19",  # VK_F19
+    0x83: "f20",  # VK_F20
 }
 
 # Console escape codes: https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2024-09-03-13-34-35.gh-issue-123572.uuqoYV.rst b/Misc/NEWS.d/next/Core_and_Builtins/2024-09-03-13-34-35.gh-issue-123572.uuqoYV.rst
new file mode 100644 (file)
index 0000000..38456ac
--- /dev/null
@@ -0,0 +1,2 @@
+Fix key mappings for various F-keys in Windows for the new REPL. Patch by
+devdanzin