Class: SDL2::Event::ControllerButton
- Inherits:
 - 
      SDL2::Event
      
        
- Object
 - SDL2::Event
 - SDL2::Event::ControllerButton
 
 
- Defined in:
 - event.c,
event.c 
Overview
This class represents the controller button events.
You don’t handle the instance of this class directly, but you handle the instances of two subclasses of this subclasses: ControllerButtonDown and ControllerButtonUp.
Direct Known Subclasses
Instance Attribute Summary collapse
- 
  
    
      #button  ⇒ Integer 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
the controller button index.
 - 
  
    
      #pressed  ⇒ Boolean 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
button is pressed or not.
 - 
  
    
      #which  ⇒ Integer 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
the controller index.
 
Attributes inherited from SDL2::Event
Instance Method Summary collapse
- 
  
    
      #inspect  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    
Inspection string.
 
Methods inherited from SDL2::Event
enable=, enabled?, poll, #window
Instance Attribute Details
#button ⇒ Integer
the controller button index
#pressed ⇒ Boolean
button is pressed or not
#which ⇒ Integer
the controller index
Instance Method Details
#inspect ⇒ String
Returns inspection string
      854 855 856 857 858 859 860 861 862 863  | 
    
      # File 'event.c', line 854
static VALUE ControllerButton_inspect(VALUE self)
{
    SDL_Event* ev; Data_Get_Struct(self, SDL_Event, ev);
    return rb_sprintf("<%s: type=%u timestamp=%u"
                      " which=%d button=%s state=%s>",
                      rb_obj_classname(self), ev->common.type, ev->common.timestamp,
                      ev->cbutton.which,
                      SDL_GameControllerGetStringForButton(ev->cbutton.button),
                      INT2BOOLCSTR(ev->cbutton.state));
}
     |