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.

Recommended Answers

All 12 Replies

Use getch() inside a thread..

??????????? What do you mean?

Probably the best place for Dark GDK question is Dark GDK community forum...
I can't imagine what's a relation between #include <conio.h> in your modules and errors in Dark GDK files...

All I want to know is how to do what getch() does without using getch().

The Errors it gives me are:

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?..

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')?

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')?

Have you ever heard about Google search? ;)
http://www.barcodeman.com/altek/mule/scandoc.php

Sorry, No luck. The arrow keys still didn't respond.

If you need any tips of Assembly or binary, please let me know! XD

commented: Got any tips on posting? -1
commented: Has nothing to do with content of question +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.