module SFML::Joystick

Global gamepad / joystick state — peer to Keyboard and Mouse.

if SFML::Joystick.connected?(0) x = SFML::Joystick.axis_position(0, :x) # -100.0 .. 100.0 fire = SFML::Joystick.button_pressed?(0, 0) info = SFML::Joystick.identification(0) # => { name: “Xbox Controller”, vendor_id: 0x045e, product_id: 0x028e } end

SFML supports up to MAX_COUNT joysticks (0..MAX_COUNT-1). Axes are addressed by symbol (:x, :y, :z, :r, :u, :v, :pov_x, :pov_y) so callers don’t have to remember the sfJoystickAxis enum order.