### Home Classes Methods

### In Files

- lib/rubygame/events.rb
- lib/rubygame/events/keyboard_events.rb
- lib/rubygame/events/clock_events.rb
- lib/rubygame/events/mouse_events.rb
- lib/rubygame/events/misc_events.rb
- lib/rubygame/events/joystick_events.rb

### Namespace

- MODULE Rubygame::Events::JoystickButtonEvent
- MODULE Rubygame::Events::KeyboardEvent
- MODULE Rubygame::Events::MouseButtonEvent
- CLASS Rubygame::Events::ClockTicked
- CLASS Rubygame::Events::InputFocusGained
- CLASS Rubygame::Events::InputFocusLost
- CLASS Rubygame::Events::JoystickAxisMoved
- CLASS Rubygame::Events::JoystickBallMoved
- CLASS Rubygame::Events::JoystickButtonPressed
- CLASS Rubygame::Events::JoystickButtonReleased
- CLASS Rubygame::Events::JoystickHatMoved
- CLASS Rubygame::Events::KeyPressed
- CLASS Rubygame::Events::KeyReleased
- CLASS Rubygame::Events::MouseFocusGained
- CLASS Rubygame::Events::MouseFocusLost
- CLASS Rubygame::Events::MouseMoved
- CLASS Rubygame::Events::MousePressed
- CLASS Rubygame::Events::MouseReleased
- CLASS Rubygame::Events::QuitRequested
- CLASS Rubygame::Events::WindowExposed
- CLASS Rubygame::Events::WindowMinimized
- CLASS Rubygame::Events::WindowResized
- CLASS Rubygame::Events::WindowUnminimized

### Methods

- ::fetch_sdl_events

### Files

- CREDITS
- LICENSE
- NEWS
- README
- ROADMAP
- custom_sdl_load_paths.rdoc
- getting_started.rdoc
- keyboard_symbols.rdoc
- macosx_install.rdoc
- managing_framerate.rdoc
- surface_palettes.rdoc
- windows_install.rdoc

### Class/Module Index

Quicksearch

- Rubygame
- Rubygame::ActiveEvent
- Rubygame::Clock
- Rubygame::Color
- Rubygame::Color::ColorBase
- Rubygame::Color::ColorHSL
- Rubygame::Color::ColorHSV
- Rubygame::Color::ColorRGB
- Rubygame::Color::Palette
- Rubygame::Event
- Rubygame::EventActions
- Rubygame::EventActions::BlockAction
- Rubygame::EventActions::MethodAction
- Rubygame::EventActions::MultiAction
- Rubygame::EventHandler
- Rubygame::EventHandler::HasEventHandler
- Rubygame::EventHook
- Rubygame::EventQueue
- Rubygame::EventTriggers
- Rubygame::EventTriggers::AndTrigger
- Rubygame::EventTriggers::AttrTrigger
- Rubygame::EventTriggers::BlockTrigger
- Rubygame::EventTriggers::InstanceOfTrigger
- Rubygame::EventTriggers::KeyPressTrigger
- Rubygame::EventTriggers::KeyReleaseTrigger
- Rubygame::EventTriggers::KindOfTrigger
- Rubygame::EventTriggers::MouseMoveTrigger
- Rubygame::EventTriggers::MousePressTrigger
- Rubygame::EventTriggers::MouseReleaseTrigger
- Rubygame::EventTriggers::OrTrigger
- Rubygame::EventTriggers::TickTrigger
- Rubygame::EventTriggers::YesTrigger
- Rubygame::Events
- Rubygame::Events::ClockTicked
- Rubygame::Events::InputFocusGained
- Rubygame::Events::InputFocusLost
- Rubygame::Events::JoystickAxisMoved
- Rubygame::Events::JoystickBallMoved
- Rubygame::Events::JoystickButtonEvent
- Rubygame::Events::JoystickButtonPressed
- Rubygame::Events::JoystickButtonReleased
- Rubygame::Events::JoystickHatMoved
- Rubygame::Events::KeyPressed
- Rubygame::Events::KeyReleased
- Rubygame::Events::KeyboardEvent
- Rubygame::Events::MouseButtonEvent
- Rubygame::Events::MouseFocusGained
- Rubygame::Events::MouseFocusLost
- Rubygame::Events::MouseMoved
- Rubygame::Events::MousePressed
- Rubygame::Events::MouseReleased
- Rubygame::Events::QuitRequested
- Rubygame::Events::WindowExposed
- Rubygame::Events::WindowMinimized
- Rubygame::Events::WindowResized
- Rubygame::Events::WindowUnminimized
- Rubygame::ExposeEvent
- Rubygame::Ftor
- Rubygame::GL
- Rubygame::Hotspot
- Rubygame::JoyAxisEvent
- Rubygame::JoyBallEvent
- Rubygame::JoyDownEvent
- Rubygame::JoyHatEvent
- Rubygame::JoyUpEvent
- Rubygame::Joystick
- Rubygame::Key
- Rubygame::KeyDownEvent
- Rubygame::KeyUpEvent
- Rubygame::MailQueue
- Rubygame::MediaBag
- Rubygame::Mixer
- Rubygame::Mixer::Music
- Rubygame::Mixer::Sample
- Rubygame::Mouse
- Rubygame::MouseDownEvent
- Rubygame::MouseMotionEvent
- Rubygame::MouseUpEvent
- Rubygame::Music
- Rubygame::NamedResource
- Rubygame::NamedResource::NamedResourceClassMethods
- Rubygame::QuitEvent
- Rubygame::Rect
- Rubygame::ResizeEvent
- Rubygame::SDLError
- Rubygame::SFont
- Rubygame::Screen
- Rubygame::Sound
- Rubygame::Sprites
- Rubygame::Sprites::DepthSortGroup
- Rubygame::Sprites::Group
- Rubygame::Sprites::LimitGroup
- Rubygame::Sprites::Sprite
- Rubygame::Sprites::UpdateGroup
- Rubygame::Surface
- Rubygame::TTF

No matching classes.

# Rubygame::Events

The Events module contains classes representing various hardware events (e.g. keyboard presses, mouse clicks) and software events (e.g. clock tick, window becomes active)

This event classes are meant as a full replacement for the older event classes defined in the Rubygame module (e.g. KeyDownEvent, QuitEvent). The old classes are deprecated and should not be used anymore.

### Public Class Methods

fetch_sdl_events() click to toggle source

NOTE: This method converts the SDL events into the new-style event classes, located in the Rubygame::Events module. For converting to the older (deprecated) events, see Rubygame.fetch_sdl_events.

Retrieves all pending events from SDL's event stack and converts them into Rubygame event objects. Returns an Array of all the events, in the order they were read.

This method is used by the EventQueue class (among others), so don't call it if you are using any of Rubygame's event management classes (e.g. EventQueue)! If you do, they will not receive all the events, because some events will have been removed from SDL's event stack by this method.

However, if you aren't using EventQueue, you can safely use this method to make your own event management system.

    # File lib/rubygame/events.rb, line 117
    def self.fetch_sdl_events
      events = []
      until( ( event = SDL::PollEvent() ).nil? )
        case ( event = _convert_sdlevent(event) )
        when Array;   events += event
        else;         events << event
        end
      end
      return events
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.