### Home Classes Methods

### In Files

- lib/rubygame/event_triggers.rb

### Namespace

- CLASS Rubygame::EventTriggers::AndTrigger
- CLASS Rubygame::EventTriggers::AttrTrigger
- CLASS Rubygame::EventTriggers::BlockTrigger
- CLASS Rubygame::EventTriggers::InstanceOfTrigger
- CLASS Rubygame::EventTriggers::KeyPressTrigger
- CLASS Rubygame::EventTriggers::KeyReleaseTrigger
- CLASS Rubygame::EventTriggers::KindOfTrigger
- CLASS Rubygame::EventTriggers::MouseMoveTrigger
- CLASS Rubygame::EventTriggers::MousePressTrigger
- CLASS Rubygame::EventTriggers::MouseReleaseTrigger
- CLASS Rubygame::EventTriggers::OrTrigger
- CLASS Rubygame::EventTriggers::TickTrigger
- CLASS Rubygame::EventTriggers::YesTrigger

### 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::EventTriggers

This module contains all the event trigger classes that come with Rubygame.

An event trigger class is simply a class which can be used as a trigger an EventHook. The trigger is used to determine whether the EventHook matches a particular event that occurs.

The only requirement for an event trigger is this:

- It must have a match? method which takes exactly one argument (an event) and always returns either true or false.

You can make your own custom event trigger classes and use them in an EventHook if they meet that requirement.

NOTE: The match? method may be called many times every second, even if there is no matching event. So, you should try to keep the method simple and fast, to have the least impact on your game's framerate.

Here is an overview of the event trigger classes that come with Rubygame as of version 2.5:

AndTrigger | Holds multiple other triggers, and matches if ALL of the triggers match the event.
OrTrigger | Holds multiple other triggers, and matches if ONE OR MORE of the triggers match the event.
AttrTrigger | Matches if the event's attributes have the expected values.
BlockTrigger | Passes the event to a custom code block to check whether it matches.
InstanceOfTrigger | Matches if the event is an instance of a particular class.
KeyPressTrigger | Matches certain KeyPressed events.
KeyReleaseTrigger | Matches certain KeyReleased events.
KindOfTrigger | Matches if the event is kind_of? a particular class or module.
MousePressTrigger | Matches certain MousePressed events.
MouseMoveTrigger | Matches certain MouseMoved events.
MouseReleaseTrigger | Matches certain MouseReleased events.
TickTrigger | Matches ClockTicked events.
YesTrigger | Matches every event, no matter what.

[Validate]

Generated with the Darkfish Rdoc Generator 2.