Re: Key-press detection



"David Sweeney" <David.Sweeney8@xxxxxxxxxxxxxx> wrote in message
news:OYGdnUcGVZFJ00nbnZ2dnUVZ8tChnZ2d@xxxxxxxxx
I am using C++ (with the Visual C++ compiler) on Windows XP, and I am
hoping to develop a simple computer game. I would like to know if there is
a way to detect which key the user is pressing, eg, if the user is pressing
'a', can that be transferred into a character? Can you write:

char c = GetKeyPress();

or something similar?

Mny thanks for help on this!

Many ways, depending on your program and if you want to use window's
callback functions and what language you're using.

What langauge ARE you using?


.



Relevant Pages

  • Re: Key-press detection
    ... David Sweeney wrote: ... I am hoping to develop a simple computer game. ... know if there is a way to detect which key the user is pressing, ... systems that handle keyboards have means of handling this, ...
    (comp.programming)
  • Re: Key-press detection
    ... I am hoping to develop a simple computer game. ... know if there is a way to detect which key the user is pressing, ... If there's no keyboard, it's likely to be quite a short game. ... Note that he did not ask for a standard solution, ...
    (comp.programming)
  • Key-press detection
    ... to develop a simple computer game. ... detect which key the user is pressing, eg, if the user is pressing 'a', can ... char c = GetKeyPress; ... Mny thanks for help on this! ...
    (comp.programming)
  • Re: program that push some button automaticaly?
    ... You're kind of SOL, then, because the C++ language doesn't define anything ... to do with 'buttons' or 'pressing'. ... Some say the Wired doesn't have political borders like the real world, ...
    (comp.lang.cpp)
  • "*.ini" Problem after SP2
    ... Since downloading SP2 a window saying "*.ini" is not ... Press enter to Get Default Language! ... Pressing enter or clicking on the red cross will not ...
    (microsoft.public.windowsxp.general)