Class: SDL2::Event::JoyButton
- Inherits:
-
SDL2::Event
- Object
- SDL2::Event
- SDL2::Event::JoyButton
- Defined in:
- event.c,
event.c
Overview
This class represents joystick button events.
You don’t handle the instance of this class directly, but you handle the instances of two subclasses of this subclasses: JoyButtonDown and JoyButtonUp.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#button ⇒ Integer
the joystick button index.
-
#pressed ⇒ Boolean
(also: #pressed?)
button is pressed or not.
-
#which ⇒ Integer
the joystick 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 joystick button index
#pressed ⇒ Boolean Also known as: pressed?
button is pressed or not
#which ⇒ Integer
the joystick index
Instance Method Details
#inspect ⇒ String
Returns inspection string
652 653 654 655 656 657 658 659 660 |
# File 'event.c', line 652
static VALUE EvJoyButton_inspect(VALUE self)
{
SDL_Event* ev; Data_Get_Struct(self, SDL_Event, ev);
return rb_sprintf("<%s: type=%u timestamp=%u"
" which=%d button=%u pressed=%s>",
rb_obj_classname(self), ev->common.type, ev->common.timestamp,
ev->jbutton.which, ev->jbutton.button,
INT2BOOLCSTR(ev->jbutton.state));
}
|