Key-press detection



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!


.



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)
  • Re: Key-press detection
    ... hoping to develop a simple computer game. ... a way to detect which key the user is pressing, eg, if the user is pressing ... callback functions and what language you're using. ... What langauge ARE you using? ...
    (comp.programming)