Thread: Plz Tell me how to Read Characters like Key UP, Key Down

  1. #1
    Registered User
    Join Date
    Aug 2002
    Posts
    5

    Plz Tell me how to Read Characters like Key UP, Key Down

    Please Help me:
    I am creating a project; where I need a line text editor
    Here,
    I am using:
    int a=bioskey();
    however It returns different values 4 different keys. So I 've to check the value of bioskey() for every key. Is there any simpler procedure?
    Plz reply fast

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    OS/Compiler?

    -Prelude
    My best code is written with the delete key.

  3. #3
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    You mean without checking ALL keys? No.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  4. #4
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765
    > Plz Tell me how to Read Characters like Key UP, Key Down
    Why don't you just scan for the ASCII values of up, down, etc..
    The world is waiting. I must leave you now.

  5. #5
    Registered User toaster's Avatar
    Join Date
    Apr 2002
    Posts
    161

    Re: Plz Tell me how to Read Characters like Key UP, Key Down

    Originally posted by arvindkr
    Please Help me:
    I am creating a project; where I need a line text editor
    Here,
    I am using:
    int a=bioskey();
    however It returns different values 4 different keys. So I 've to check the value of bioskey() for every key. Is there any simpler procedure?
    Plz reply fast
    I think I understand what you are trying to say.
    If you meant that you are sick and tired of searching the value for every key and want an easier method, there are several options:

    some solutions:

    -go find a site that shows a conversion chart between the keys and the codes (ASCII, scan codes, bios codes?, etcetera)...

    or

    -you can just do a simple loop that will output a simple conversion chart or list between the keys and the codes

    by the way, you are using bios.h, right?
    think only with code.
    write only with source.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 10:39 PM
  2. sequential file program
    By needhelpbad in forum C Programming
    Replies: 80
    Last Post: 06-08-2008, 01:04 PM
  3. BCB Key press problem
    By Death_Wraith in forum Game Programming
    Replies: 0
    Last Post: 05-30-2004, 03:13 PM
  4. Serial Communications in C
    By ExDigit in forum Windows Programming
    Replies: 7
    Last Post: 01-09-2002, 10:52 AM