skill:get a input value from keyboard

Discussion in 'Cadence' started by camelot, Nov 21, 2008.

  1. camelot

    camelot Guest

    Hi,
    I have a little problem. I have to get a space key pressed to allow
    the program go on to other operations. I'm using batch skill in a
    shell and no under Opus so bindkeys are not available. However, is
    there a way to get a char or a string from keyboard and store it in a
    variable? Something like that allow user to get information i a skill
    batch session.

    Thank you,

    Giuseppe
     
    camelot, Nov 21, 2008
    #1
  2. camelot

    S. Badel Guest

    The following should work under unix. Not sure how portable though.

    use waitForKey(32) for spacebar.

    Stéphane


    procedure( getch()
    let( (c)
    system("stty -echo raw")
    c = getc(piport)
    system("stty echo -raw")
    charToInt(c)
    ) ; let
    ) ; procedure

    procedure( waitForKey(k)
    while( k>=32 && k<=127 && getch() != k t )
    )
     
    S. Badel, Nov 21, 2008
    #2
  3. camelot

    camelot Guest

    Hi, thank you for the suggestion but in my case I would like to check
    the key press without a pause until the key is pressed...

    Camelot
     
    camelot, Nov 26, 2008
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.