Пример #1
0
void Input::Reset() {
    ResetName();
    ResetPassword();
    Field = GET_NAME;
    Action = WAIT;
}
Пример #2
0
/*  KeyManager - intercept keystrokes and hand them to the active window
 *
 *  We use the top of winList as the current input focus.  All input is handed
 *  to the window procedure EXCEPT for the tab key.  The tab key is responsible
 *  for placing the top window on the bottom of the stack to cycle through the
 *  set of windows.
 *
 */
VOID PASCAL INTERNAL KeyManager (VOID)
{
    LONG    now;
#if defined (HEAPCRAP)
    INT     fHeapChk;
#endif

    /*  do script first in case in contains a password command
     */
    if ( pInitScript )
        DoScript ( hCommand, pInitScript, 0 );

    if (fMailAllowed) {
        GetAliases ( fNotifyTools & F_LOADALIAS );
        fNotifyTools &= ~(FLAG)F_LOADALIAS;
        NotifyTools ( );
        }
    if ( fComposeOnBoot )
        ( *( winList->wndProc ) ) ( winList, KEY, 0 );

    SendMessage ( hCommand, DISPPROMPT, TRUE );

    while ( ( winList != NULL ) && ( !fQuit ) ) {
        time ( &now );
	CheckTimeDisplay ( now );

        if ( pInitHdrCmd ) {
            DoHeaders ( hCommand, pInitHdrCmd, TRUE );
            SendMessage ( hCommand, DISPPROMPT, 0 );
            ZMfree ( pInitHdrCmd );
            pInitHdrCmd = NULL;
        }

        /*  if system has not received a char for 10 sec then checkmail
         */
        if (fMailAllowed)
            CheckMail ( now );

        /*  time out password after (default) 6 hours in case user has
         *  left WZMAIL running and gone home
         */
        if ( now > lTmPassword + lPasswordAge )
            ResetPassword ( );

        if ( now > lTmConnect + cSecConnect )
            ZMDisconnect ( );

        /*  On multitasking systems, it is rude to go into polling loops.
         *
         *  For OS/2, we have a separate thread dedicated to reading from the
         *  console.  We clear a semaphore to let him read and then wait on
         *  a response semaphore with the specified timeout.  This avoids
         *  polling.
         *
         *  For real mode DOS, we presume that INT 16 (poll) will cause an
         *  explicit yield to other runnable threads.
         */
        if (kbwait (60 * 1000)) {

            fMailUnSeen = FALSE;

            do {
                (*winList->wndProc) ( winList, KEY, ReadKey() );

            } while (!fQuit && kbwait (10000));
        }

#if defined (HEAPCRAP)
        if ( ( fHeapChk = heapchk ( ) ) != HEAPOK ) {
            fprintf ( stderr, "%s\n",
                ( fHeapChk == HEAPBADBEGIN ? "Can't find heap" :
                    "Damaged heap" ) );
            assert ( fHeapChk == HEAPOK );
            }
#endif

    }
    return;
}