this seems to be the proper way under ms, but it won't work under wine
authorMarkus Bröker <mbroeker@largo.dyndns.tv>
Sat, 13 Dec 2008 17:58:16 +0100
changeset 23 7acfc5eda7ed
parent 22 0db9235d68d9
child 24 9cdad6c45b47
this seems to be the proper way under ms, but it won't work under wine committer: Markus Bröker <mbroeker@largo.homelinux.org>
db_bridge/console.cpp
--- a/db_bridge/console.cpp
+++ b/db_bridge/console.cpp
@@ -1,22 +1,22 @@
+/**
+ * test/demos/db_bridge/console.cpp
+ * Copyright (C) Markus Broeker
+ */
+
 #include <console.h>
 #include <cstdio>
 
 #ifdef WIN32
-#include <windows.h>
 #include <conio.h>
 
 int Console::getch ()
 {
-    int pressed = 0;
     int ch = -1;
 
-    while (!pressed) {
-        if (kbhit ()) {
-            ch =::getch ();
-            pressed = 1;
-        }
-        Sleep (10);
+    while (!kbhit ()) {
+        ch =::getch ();
     }
+
     return ch;
 }
 #else