Ignore:
Timestamp:
May 15, 2011, 6:22:13 AM (11 years ago)
Author:
Sam Hocevar
Message:

imlib: move generic code back into the platform-agnostic imlib.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/sdlport/event.cpp

    r652 r656  
    5151
    5252//
    53 // get_key_flags()
    54 // Return the flag for the key modifiers
    55 //
    56 int EventHandler::get_key_flags()
    57 {
    58     SDLMod key_flag = SDL_GetModState();
    59 
    60     return ((key_flag & KMOD_SHIFT) != 0) << 3 |
    61            ((key_flag & KMOD_CTRL) != 0) << 2 |
    62            ((key_flag & KMOD_ALT) != 0) << 1;
    63 }
    64 
    65 //
    6653// IsPending()
    6754// Are there any events in the queue?
     
    7663
    7764//
    78 // get_event()
    7965// Get and handle waiting events
    8066//
    81 void EventHandler::Get(Event &ev)
     67void EventHandler::SysEvent(Event &ev)
    8268{
    83     while(!m_pending)
    84     {
    85         IsPending();
    86 
    87         if (!m_pending)
    88         {
    89             // Sleep for 1 millisecond if there are no events
    90             Timer tmp; tmp.WaitMs(1);
    91         }
    92     }
    93 
    94     Event *ep = (Event *)m_events.first();
    95     if(ep)
    96     {
    97         ev = *ep;
    98         m_events.unlink(ep);
    99         delete ep;
    100         m_pending = m_events.first() != NULL;
    101         return;
    102     }
    103 
    10469    // No more events
    10570    m_pending = 0;
Note: See TracChangeset for help on using the changeset viewer.