   Key Press
  Is there any way to sense if a specific key is pressed?such as 'Y' and 'N' for a yes/no question.[edited by - bgaming on February 15, 2004 12:47:06 AM][edited by - bgaming on February 15, 2004 12:47:16 AM][edited by - bgaming on February 16, 2004 1:05:40 AM]
if (input == 'y')  //do stuffelse  //do other stuff "Next time a terrorist gets freed after ten months of red tape, I’ll be sure to thank [the democrats]. I guarantee you that if someone is put in prison with the Patriot Act, even in the rare chance they are not a terrorist or have connections to terrorism, they are sure as hell guilty of something." -- A True Die-Hard American Patriot    [edited by - Mscgamer on February 15, 2004 12:50:59 AM];  Many ways.  Depends on your platform.  Look into scanf and getch in you''re doing console stuff.Msc''s code is broken because a comparison of that nature needs a ''=='' and not ''='', but that''s the gist, provided input is a char containing your input.  Seemed your question was more along the lines of how to get input in the first place, though, so I hope I''ve helped.Later,ZE.   //email me.//zealouselixir software.//msdn.//n00biez.//miscellaneous links;quote:Original post by ZealousElixir  Msc''s code is broken because a comparison of that nature needs a ''=='' and not ''='', but that''s the gist, provided input is a char containing your input.  Seemed your question was more along the lines of how to get   input in the first place, though, so I hope I''ve helped.I''m mixing Pascal in with my C++.  "Next time a terrorist gets freed after ten months of red tape, I’ll be sure to thank [the democrats]. I guarantee you that if someone is put in prison with the Patriot Act, even in the rare chance they are not a terrorist or have connections to terrorism, they are sure as hell guilty of something." -- A True Die-Hard American Patriot ;  I need it to copy Blitz BASIC''s KeyHit() functioneach key has a code, and it asks whether they key has been pressed.I need it to read if the up or down buttons have been pressed, as well as others. ;  There are several methods, and what you use to some extent depends on exactly what it is your doing (console app, windowed app, cross platform, etc), but you may want to do some research on DirectInput (the input part of DirectX).GD.net DInput articles: http://www.gamedev.net/reference/list.asp?categoryid=24#52A specific article: http://www.gamedev.net/reference/articles/article1607.aspPrevious forum-threads (not neccesarily DInput, but on topic to your question):http://www.gamedev.net/community/forums/topic.asp?topic_id=174514http://www.gamedev.net/community/forums/topic.asp?topic_id=69967http://www.gamedev.net/community/forums/topic.asp?topic_id=201314http://www.gamedev.net/community/forums/topic.asp?topic_id=164690Some good places to research:Gamedev.net articles & resourcesGamedev.net forum searchGoogleDo some research on it, and give it a try by yourself - if your having trouble after that, come back with some specific questions and your attempt at coding a solution and I'm sure someone will help you out with it.   [edited by - kazgoroth on February 16, 2004 9:47:13 AM]