Class: SDL2::Joystick::Hats

Inherits:
Components show all
Defined in:
lib/sdl2/joystick/hats.rb

Overview

Enumerates hats on a joystick.

Instance Method Summary collapse

Methods inherited from Components

#each, #initialize

Constructor Details

This class inherits a constructor from SDL2::Joystick::Components

Instance Method Details

#[](idx) ⇒ Object

Hat accessor via index



17
18
19
# File 'lib/sdl2/joystick/hats.rb', line 17

def [](idx)
  SDL2::joystick_get_hat(@joystick,idx)       
end

#countObject

How many hats are there?



11
12
13
# File 'lib/sdl2/joystick/hats.rb', line 11

def count
  SDL2::joystick_num_hats(@joystick)
end