浏览代码

use native sys_getch

Nicolas Cannasse 12 年之前
父节点
当前提交
7f29557461
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      interp.ml

+ 1 - 1
interp.ml

@@ -1711,7 +1711,7 @@ let std_lib =
 		);
 		);
 		"sys_getch", Fun1 (fun echo ->
 		"sys_getch", Fun1 (fun echo ->
 			match echo with
 			match echo with
-			| VBool _ -> VInt (int_of_char (input_char Pervasives.stdin))
+			| VBool b -> VInt (Extc.getch b)
 			| _ -> error()
 			| _ -> error()
 		);
 		);
 		"sys_get_pid", Fun0 (fun() ->
 		"sys_get_pid", Fun0 (fun() ->