Thread: key press in c++

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    3

    Smile key press in c++

    anybody can tell me how in c++ dos based to replace "enter key" to executing something with another key for example "a".
    please reply me to [email protected]

    regards

    febrian

  2. #2
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802
    This isn't your own personal help board... NO one is going to email you. This board has a notify-by-email feature... USE it.

    As for the question, do you mean input? Like, typing out a message and entering it in with the 'a' key?

    Code:
    char pszBuffer[256];
    cin.getline(pszBuffer, 255, 'a');
    That code would read a line of characters from the user; although instead of ending and returning with the enter key, the 'a' key now ends the input procedure.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 11-23-2007, 01:48 PM
  2. Virtual keys
    By Arkanos in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2005, 10:00 AM
  3. Directional Keys - Useing in Console
    By RoD in forum C++ Programming
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM
  4. FAQ: Directional Keys - Useing in Console
    By RoD in forum FAQ Board
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM