| | |
Key imput without getch()
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
Hi
I am writing a 2D game that only uses the arrow keys for input. I have done a search on this site fro ways to get input from the arrow keys and have come up with many solutions. However all of them use the getch() function. Normally this would be OK but for this project one of the files that I have to include raises 4 errors and a warning when I include <conio.h> (the header for getch()). The file that doesn't like getch() is DarkGDK, which I downloaded from www.msdn.com for its ease of use when creating games.
I was wondering if there are any alternatives.
I am using Visual C++ 2008 Express running on Windows XP.
I am writing a 2D game that only uses the arrow keys for input. I have done a search on this site fro ways to get input from the arrow keys and have come up with many solutions. However all of them use the getch() function. Normally this would be OK but for this project one of the files that I have to include raises 4 errors and a warning when I include <conio.h> (the header for getch()). The file that doesn't like getch() is DarkGDK, which I downloaded from www.msdn.com for its ease of use when creating games.
I was wondering if there are any alternatives.
I am using Visual C++ 2008 Express running on Windows XP.
The Errors it gives me are:
C++ Syntax (Toggle Plain Text)
libcpmtd.lib(xdebug.obj) : warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library Main.obj : error LNK2019: unresolved external symbol _wgetch referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ) Main.obj : error LNK2019: unresolved external symbol _keypad referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ) Main.obj : error LNK2001: unresolved external symbol __imp__stdscr Main.obj : error LNK2019: unresolved external symbol _noecho referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ) Main.obj : error LNK2019: unresolved external symbol _cbreak referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ) Main.obj : error LNK2019: unresolved external symbol _initscr referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ) libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z) libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __free_dbg referenced in function "void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &,char *,int)" (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z) Debug\Snake.exe : fatal error LNK1120: 8 unresolved externals
As far as I know Dark GDK application HAS NO CONSOLE at all. If so you can't use conio.h or Windows API ReadConsole stuff. It's GUI application. Dark GDK has its own keyboard event handling and corresponding API. You can find more info in DarkGDK docs or ask Dark GDK guru on Dark GDK forum.
May be I'm wrong?..
May be I'm wrong?..
•
•
•
•
I found what I was looking for on the DarkGDK forum but does anyone know where to view a map of the keyboard with the numbers that correspond to the keys (ex: 71=num pad '8')?

http://www.barcodeman.com/altek/mule/scandoc.php
![]() |
Other Threads in the C++ Forum
- Previous Thread: setting size of 2-D array at constructor issue
- Next Thread: annother prolem with arrays
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count database delete deploy developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






