Module Rubygame::Events::JoystickButtonEvent
In: lib/rubygame/events/joystick_events.rb

JoystickButtonEvent is a mixin module included in the JoystickButtonPressed and JoystickButtonReleased classes. It defines the joystick_id and button attribute readers.

Methods

new  

Attributes

button  [R] 
joystick_id  [R] 

Public Class methods

Initializes the JoystickButtonEvent.

joystick_id:an integer identifying which joystick changed. The first joystick is 0.
button:an integer identifying which button was pressed or released. The first button on each joystick is 0.

[Source]

# File lib/rubygame/events/joystick_events.rb, line 105
      def initialize( joystick_id, button )

        unless joystick_id.kind_of?(Fixnum) and joystick_id >= 0
          raise ArgumentError, "joystick_id must be an integer >= 0"
        end

        @joystick_id = joystick_id

        unless button.kind_of?(Fixnum) and button >= 0
          raise ArgumentError, "button must be an integer >= 0"
        end

        @button = button

      end

[Validate]