Process key and mouse events on SDL2