From 48a917735916f559106d187cb419ba7c44b00d1c Mon Sep 17 00:00:00 2001 From: Jhonatan Lopes Date: Thu, 21 Oct 2021 15:08:48 -0300 Subject: [PATCH 1/2] Update scan codes for arrows on Windows --- readchar/readchar.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/readchar/readchar.py b/readchar/readchar.py index fc35429..5c1a75d 100644 --- a/readchar/readchar.py +++ b/readchar/readchar.py @@ -53,10 +53,10 @@ 20960: key.PAGE_DOWN, 18400: key.HOME, 20448: key.END, - 18656: key.UP, - 20704: key.DOWN, - 19424: key.LEFT, - 19936: key.RIGHT, + 18432: key.UP, # 72 * 256 + 20480: key.DOWN, # 80 * 256 + 19200: key.LEFT, # 75 * 256 + 19712: key.RIGHT, # 77 * 256 } def readkey(getchar_fn=None): From 9b74c495605195f214b45bb09226bb51597ffb8c Mon Sep 17 00:00:00 2001 From: Jhonatan Lopes Date: Thu, 21 Oct 2021 15:11:47 -0300 Subject: [PATCH 2/2] Updated backspace character code on Windows --- readchar/key.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readchar/key.py b/readchar/key.py index 8fb83da..c7d4df5 100644 --- a/readchar/key.py +++ b/readchar/key.py @@ -2,7 +2,7 @@ LF = "\x0d" CR = "\x0a" ENTER = "\x0d" -BACKSPACE = "\x7f" +BACKSPACE = "\x08" SUPR = "" SPACE = "\x20" ESC = "\x1b"