Browse Source

use Msvcrt.getchw instead of Msvcrt.getch for Sys.getChar

* change impl of  Sys.getChar to use getchw on windows (should fix some special char inputs)
* Add getchw to python.lib.Msvcrt
toraganer 7 years ago
parent
commit
81f9f49559
2 changed files with 5 additions and 4 deletions
  1. 3 2
      std/python/_std/Sys.hx
  2. 2 2
      std/python/lib/Msvcrt.hx

+ 3 - 2
std/python/_std/Sys.hx

@@ -141,7 +141,8 @@ class Sys {
 				}
 
 			case "Windows":
-				python.lib.Msvcrt.getch().decode("utf-8").charCodeAt(0);
+				//python.lib.Msvcrt.getch().decode("utf-8").charCodeAt(0);
+				python.lib.Msvcrt.getwch().charCodeAt(0);
 			case var x :
 				throw "platform " + x + " not supported";
 		}
@@ -164,4 +165,4 @@ class Sys {
 	}
 
 
-}
+}

+ 2 - 2
std/python/lib/Msvcrt.hx

@@ -25,5 +25,5 @@ package python.lib;
 extern class Msvcrt {
 
 	public static function getch ():python.Bytes;
-
-}
+	public static function getwch ():String;
+}