Key input

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2008
Posts: 11
Reputation: egolovin is an unknown quantity at this point 
Solved Threads: 0
egolovin egolovin is offline Offline
Newbie Poster

Key input

 
0
  #1
Nov 24th, 2008
I am looking for a command where i can press m and it pulls up my menu function. i feel retarded cause i tried to look it up but i dont know what i should look for exactly

i know qbasic has a inkey command but i cant figure it out on c++
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 input

 
0
  #2
Nov 24th, 2008
Qbasic is not a general purpose platform-independent language, it's a concrete implementation of Basic language dialect. No keyboard notion per se in the C++ language. There are lots of keyboard access functions and libraries in C++ implementations.
What's your C++ compiler?
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 11
Reputation: egolovin is an unknown quantity at this point 
Solved Threads: 0
egolovin egolovin is offline Offline
Newbie Poster

Re: Key input

 
0
  #3
Nov 24th, 2008
visual c++
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,114
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 281
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: Key input

 
0
  #4
Nov 24th, 2008
Your best bet is to press "M<return>" and use fgets() to read the input and process the first character. It's portable and will work on ALL compilers.
Last edited by WaltP; Nov 24th, 2008 at 6:28 pm.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
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 input

 
0
  #5
Nov 24th, 2008
Originally Posted by egolovin View Post
visual c++
Have a look at non-standard header <conio.h>. Use getch/getche functions (in console mode applications only - hi, qbasic ). If you are developing GUI application, keyboard key access depends of selected GUI platform...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC