A simple question

Is there a function that is capable of getting the keyboard functionallity keys(such as right left up down and enter)?
Stober said you might know something about it

Comments

  • : Is there a function that is capable of getting the keyboard functionallity keys(such as right left up down and enter)?
    : Stober said you might know something about it
    : Try using the bioskey() defined in bios.h
    You can assign the return value to an integer and compare to get the keystroke. First experiment with the code and print out the values and keep these values as reference. The ordinary getch() routine can also be used. If the getch() returns 0 then call getch() again to retrieve the scan code of the keystroke.

    Eg: int key=bioskey(0);
    if(key==20480)cout<<"Down arrow pressed";

    getch()
    =======
    char ch=getch();
    if(ch==0)ch=getch();// this getch() reads the scan code for two byte keystrokes.

    Bye,
    Binesh Andrews



  • You could find out the char integer value and do it that way also like:

    char a = integer value;

    Note: not valid syntax which may be obvious.

    Bye,
    George

    <------------------------------------------>

    Reach me at:

    AIM IM: kc2keo
    EMAIL: kc2keo@yahoo.com

  • To add onto what I have said in my previous post you also may consider using.

    [code]
    #include
    [/code]

    with that in mind I have seen a tutorial that uses that header file for moving around the screen. My previous post explains a different approach.

    go here:

    http://www.gametutorials.com

    Bye,
    George

    <------------------------------------------>

    Reach me at:

    AIM IM: kc2keo
    EMAIL: kc2keo@yahoo.com

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories