فهرست منبع

msvcrt.getchar returns an int

frabbit 11 سال پیش
والد
کامیت
39de7d85ec
2فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 3 3
      std/python/_std/Sys.hx
  2. 1 1
      std/python/lib/Msvcrt.hx

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

@@ -83,9 +83,9 @@ class Sys {
 
 				try {
 					python.lib.Tty.setraw(fd);
-					var ch = python.lib.Sys.stdin.read(1);
+					var x = python.lib.Sys.stdin.read(1);
 					restore();
-					ch;
+					x.charCodeAt(0);
 				} catch (e:Dynamic) {
 					restore();
 					throw e;
@@ -96,7 +96,7 @@ class Sys {
 			case x :
 				throw "platform " + x + " not supported";
 		}
-		return ch.charCodeAt(0);
+		return ch;
 	}
 
 	public static function stdin() : haxe.io.Input {

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

@@ -3,7 +3,7 @@ package python.lib;
 
 extern class Msvcrt {
 
-	public static function getch ():String;
+	public static function getch ():Int;
 
 	static function __init__ ():Void
 	{