dbAccess: wait for a key pressed

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

  1. camelot

    camelot Guest

    Hi All,
    I have a code like this in dbAccess mode:

    while(flag == nil

    if(//SPACE bar is pressed// then flag = t)
    ; do some operations....

    How could I implement: //SPACE bar is pressed// check?


    p.s. bindkeys are not available in dbAccess mode.
    camelot, Nov 21, 2008
  2. camelot

    cadence Guest

    I would be very surprised if there is access to the keyboard in
    dbAccess. However, since
    you have the SKILL language primitives available you can call
    functions like read available.
    Do you really want to know whether the space bar is still pressed and
    not yet released?
    or do you want to know whether the space bar has been pressed at some
    point in the past?
    or whether there is a space waiting in stdin?

    If you really want to monitor keyboard events and trigger SKILL
    function on certain events
    I can indeed think of some very complicated ways of doing that.
    basically not running
    dbAccess directly but rather as a subprocess of another program which
    can monitor
    such events... e.g., wish/tcl.

    It might be interested to know why you need to get asynchronous input
    in your application?
    cadence, Nov 22, 2008
  3. camelot

    camelot Guest

    before the while loop starts, I launched several process through csh
    scripts that write some "end process" informattion on a log file.
    Inside the loop I monitor if all process completed successfully they
    tasks. What I wnato to do is to allow user to to finish the jobs
    prematurally by pressing a key. You idea to use an external script
    also for this situation could be a goos solution.

    Thank you,

    camelot, Nov 25, 2008
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.