Exforsys
+ Reply to Thread
Results 1 to 5 of 5

Is there any predefined function

This is a discussion on Is there any predefined function within the C and C++ forums, part of the Programming Talk category; Is there any predefined function or command available in C programming language for detecting key press of a user? I ...

  1. #1
    Ralph is offline Senior Member Array
    Join Date
    Apr 2006
    Answers
    114

    Is there any predefined function

    Is there any predefined function or command available in C programming language for detecting key press of a user? I am using windows XP operating system.


  2. #2
    Allan is offline Member Array
    Join Date
    May 2006
    Answers
    40
    There are various ways of getting the value of key pressed and then detecting the key presses. One way is to use getchar() function in C program which returns the ASCII value of the key pressed.


  3. #3
    blenda is offline Member Array
    Join Date
    May 2006
    Answers
    36
    I think you can also make use of getch() function to get your results. Someone kindly update me on this.


  4. #4
    norman is offline Member Array
    Join Date
    May 2006
    Answers
    43
    I think shift key has problem using getchar() but for shift key you can use getch().Someone correct me if I am wrong. Also I think there may be some keys which do not have associated ASCII equivalents.


  5. #5
    priyaraji is offline Member Array
    Join Date
    Apr 2006
    Answers
    52
    Yes you right there may be some keys which do not have associated ASCII equivalents. For handling such instances make use of virtual key codes to detect the key pressed.


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...