src/Utils/IoPoller.cpp
// feed an event into `IoPoller`, which may update some internal datastructures
feed an event into `IoPoller`, which may update some internal datastructures
feed an event into ` IoPoller ` which may update some internal datastructures
void osc::IoPoller::onEvent(SDL_Event const& e)
{
    if (e.type == SDL_MOUSEBUTTONDOWN)
    {
        switch (e.button.button) {
        case SDL_BUTTON_LEFT: _mousePressedEvents[0] = true; break;
        case SDL_BUTTON_RIGHT: _mousePressedEvents[1] = true; break;
        case SDL_BUTTON_MIDDLE: _mousePressedEvents[2] = true; break;
        }
    }
    else if (e.type == SDL_KEYUP || e.type == SDL_KEYDOWN)
    {
        KeysDown[e.key.keysym.scancode] = e.type == SDL_KEYDOWN;
        KeyShift = App::cur().isShiftPressed();
        KeyCtrl = App::cur().isCtrlPressed();
        KeyAlt = App::cur().isAltPressed();
    }
}
void osc :: IoPoller :: onEvent ( SDL_Event const & e ) { if ( e . type == SDL_MOUSEBUTTONDOWN ) { switch ( e . button . button ) { case SDL_BUTTON_LEFT : _mousePressedEvents [ 0 ] = true ; break ; case SDL_BUTTON_RIGHT : _mousePressedEvents [ 1 ] = true ; break ; case SDL_BUTTON_MIDDLE : _mousePressedEvents [ 2 ] = true ; break ; } } else if ( e . type == SDL_KEYUP || e . type == SDL_KEYDOWN ) { KeysDown [ e . key . keysym . scancode ] = e . type == SDL_KEYDOWN ; KeyShift = App :: cur ( ) . isShiftPressed ( ) ; KeyCtrl = App :: cur ( ) . isCtrlPressed ( ) ; KeyAlt = App :: cur ( ) . isAltPressed ( ) ; } }
feed an event into `IoPoller`, which may update some internal datastructures
feed an event into ` IoPoller ` which may update some internal datastructures