Re: Key-press detection



David Sweeney wrote:

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?

Not without using something non-standard and system-specific. Most
systems that handle keyboards have means of handling this, but it
can't be standard, because the keyboard may not exist.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>



--
Posted via a free Usenet account from http://www.teranews.com

.



Relevant Pages

  • Re: Use US Type 6 USB keyboard in the UK?
    ... On Tue, 16 Oct 2007, Dave wrote: ... Or are there electrical differences, such that pressing a key in the same ... location, on different keyboards, with the same software, will cause a ...
    (comp.unix.solaris)
  • 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: FN Key
    ... > Someone accidently pressed the fn key on their laptop. ... on my Sony keyboard the arrow keys have additional ... Pressing Fn+left arrow is the End ... function for which keyboards with more keys have a separate End key. ...
    (microsoft.public.office.misc)
  • Re: Ive created a small online app to draw diagrams in ASCII...
    ... holding shift and pressing a number key to the left of backspace (on ... for other countries' standard keyboards, ...
    (comp.lang.php)
  • 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)