Thread: directional keys @ console

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    52

    directional keys @ console

    Hi!
    I had troubles to use scanf funtion as I post yesterday.
    Now I'm using the function getche and I put an IF to verify if the key is backspace and then ignore it (I add each typed char to a "string"). Works fine when backspace key (ASCII=8) is pressed, but don't work if directional key is pressed. I tried its ASCII keycodes but don't worked.
    Last edited by ipe; 03-13-2003 at 04:20 AM.

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Extended keys normally require 2 calls the getch(), the first returns 0x00 and the second returns a value for that key. This has been discussed a few times before, try a board search and see what you find.


    [edit]
    Try the FAQ:
    http://cboard.cprogramming.com/showt...threadid=25946
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Directional Keys - Useing in Console
    By RoD in forum C++ Programming
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM
  2. FAQ: Directional Keys - Useing in Console
    By RoD in forum FAQ Board
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM
  3. Reading Arrow keys from console
    By D in forum C Programming
    Replies: 5
    Last Post: 02-22-2002, 04:46 PM
  4. Arrow keys in console?
    By SyntaxBubble in forum C++ Programming
    Replies: 3
    Last Post: 02-02-2002, 06:12 PM