Key imput without getch()

Thread Solved
Reply

Join Date: Jun 2008
Posts: 89
Reputation: waldchr is an unknown quantity at this point 
Solved Threads: 6
waldchr's Avatar
waldchr waldchr is offline Offline
Junior Poster in Training

Key imput without getch()

 
0
  #1
Nov 22nd, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 320
Reputation: cikara21 is an unknown quantity at this point 
Solved Threads: 63
cikara21's Avatar
cikara21 cikara21 is offline Offline
Posting Whiz

Re: Key imput without getch()

 
0
  #2
Nov 22nd, 2008
Use getch() inside a thread..
.:-cikara21-:.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 89
Reputation: waldchr is an unknown quantity at this point 
Solved Threads: 6
waldchr's Avatar
waldchr waldchr is offline Offline
Junior Poster in Training

Re: Key imput without getch()

 
0
  #3
Nov 22nd, 2008
??????????? What do you mean?
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: Key imput without getch()

 
0
  #4
Nov 22nd, 2008
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...
Last edited by ArkM; Nov 22nd, 2008 at 1:24 pm.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 89
Reputation: waldchr is an unknown quantity at this point 
Solved Threads: 6
waldchr's Avatar
waldchr waldchr is offline Offline
Junior Poster in Training

Re: Key imput without getch()

 
0
  #5
Nov 23rd, 2008
All I want to know is how to do what getch() does without using getch().
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 89
Reputation: waldchr is an unknown quantity at this point 
Solved Threads: 6
waldchr's Avatar
waldchr waldchr is offline Offline
Junior Poster in Training

Re: Key imput without getch()

 
0
  #6
Nov 23rd, 2008
The Errors it gives me are:

  1. libcpmtd.lib(xdebug.obj) : warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
  2.  
  3. Main.obj : error LNK2019: unresolved external symbol _wgetch referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)
  4.  
  5. Main.obj : error LNK2019: unresolved external symbol _keypad referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)
  6.  
  7. Main.obj : error LNK2001: unresolved external symbol __imp__stdscr
  8.  
  9. Main.obj : error LNK2019: unresolved external symbol _noecho referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)
  10.  
  11. Main.obj : error LNK2019: unresolved external symbol _cbreak referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)
  12.  
  13. Main.obj : error LNK2019: unresolved external symbol _initscr referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)
  14.  
  15. 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)
  16.  
  17. 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)
  18.  
  19. Debug\Snake.exe : fatal error LNK1120: 8 unresolved externals
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: Key imput without getch()

 
0
  #7
Nov 23rd, 2008
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?..
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 89
Reputation: waldchr is an unknown quantity at this point 
Solved Threads: 6
waldchr's Avatar
waldchr waldchr is offline Offline
Junior Poster in Training

Re: Key imput without getch()

 
0
  #8
Nov 23rd, 2008
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')?
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 160
Reputation: dmanw100 is on a distinguished road 
Solved Threads: 12
dmanw100's Avatar
dmanw100 dmanw100 is offline Offline
Junior Poster

Re: Key imput without getch()

 
0
  #9
Nov 23rd, 2008
I believe what you're looking for would be the ASCII character codes.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: Key imput without getch()

 
0
  #10
Nov 24th, 2008
Originally Posted by waldchr View Post
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
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC