Real-Time Delays

version 1/100607 by Erik Temple

  • Home page
  • Beginning
  • Previous



  • Section - I6 Delay routines

    Include (-

    [ EscDelay key ix;
        while (wait_flag) {
            glk_select(gg_event);
            ix = HandleGlkEvent(gg_event, 0, gg_arguments);
        }
    ];

    [ WaitDelay key ix;
        glk_request_char_event(gg_mainwin);
        while (wait_flag) {
            glk_select(gg_event);
            ix = HandleGlkEvent(gg_event, 1, gg_arguments);
            if (ix >= 0 && gg_event-->0 == 2) {
                key = gg_event-->2;
                if ((key == $fffffff8) || (key == -6) || (key == 3) || (key == 32)) {
                    wait_flag = 0;
                }
            }
        }
        glk_cancel_char_event(gg_mainwin);
    ];

    -)


    Real-Time Delays ends here.