Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3341 for code


Ignore:
Timestamp:
Jul 24, 2009, 11:17:34 AM (15 years ago)
Author:
rgrieder
Message:

Dedicated input thread now ends without hitting enter on Unix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/gamestates/GSDedicated.cc

    r3304 r3341  
    9898        resetTerminalMode();
    9999        delete this->originalTerminalSettings_;
    100 #endif
     100#else
    101101        COUT(0) << "Press enter to end the game..." << std::endl;
     102#endif
    102103        inputThread_->join();
    103104        delete this->inputThread_;
     
    121122        while(!closeThread_)
    122123        {
    123             c = getchar();
     124            size_t count = read(STDIN_FILENO, &c, 1);
     125            if (count == 1)
    124126            {
    125127//                 boost::recursive_mutex::scoped_lock(this->inputLineMutex_);
     
    251253        new_settings.c_lflag &= ~( ICANON | ECHO );
    252254//         new_settings.c_lflag |= ( ISIG | IEXTEN );
    253         new_settings.c_cc[VTIME] = 0;
    254         new_settings.c_cc[VMIN] = 1;
     255        new_settings.c_cc[VTIME] = 1;
     256        new_settings.c_cc[VMIN] = 0;
    255257        tcsetattr(0,TCSANOW,&new_settings);
    256258        COUT(0) << endl;
Note: See TracChangeset for help on using the changeset viewer.