problem

F

fireangel

i am a beginner in C. I am trying to make a game(pool) in C however
there is a problem it does not take arrow key inputs.Plz help
 
N

Nelu

fireangel said:
i am a beginner in C. I am trying to make a game(pool) in C however
there is a problem it does not take arrow key inputs.Plz help

It seems the mouse inputs are much more efficient.

Really, now... what are you trying to do and how do you want
to accomplish that?
 
I

Ico

fireangel said:
i am a beginner in C. I am trying to make a game(pool) in C however
there is a problem it does not take arrow key inputs.


Before posting in a newsgroup, read the FAQ to see if it covers your
question.

http://c-faq.com/osdep/specialkeys.html

Q: How do I read the arrow keys? What about function keys?

A: Terminfo, some versions of termcap, and some versions of curses have
support for these non-ASCII keys. Typically, a special key sends a
multicharacter sequence (usually beginning with ESC, '\033'); parsing
these can be tricky. (curses will do the parsing for you, if you call
keypad first.)

Under MS-DOS, if you receive a character with value 0 (not '0'!) while
reading the keyboard, it's a flag indicating that the next character
read will be a code indicating a special key. See any DOS programming
guide for lists of keyboard scan codes. (Very briefly: the up, left,
right, and down arrow keys are 72, 75, 77, and 80, and the function keys
are 59 through 68.)
 
W

Walter Roberson

i am a beginner in C. I am trying to make a game(pool) in C however
there is a problem it does not take arrow key inputs.Plz help

The existance of arrow keys is not part of the C standard,
and there are several different common ways to implement arrow
keys. Thus your question is platform dependant (and possibly
software version dependant), and you need to ask the question
on a platform-specific newsgroup.

You will not be able to implement your code in a portable
manner. (If as much portability -as practical- is a concern,
search for information on the "curses" library.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,183
Messages
2,570,969
Members
47,524
Latest member
ecomwebdesign

Latest Threads

Top