class GSF::Joysticks

Overview

NOTE buttons and axes mapped from Xbox 360 controller not sure if these are standardized across different controllers

Defined in:

gsf/joysticks.cr

Constant Summary

AxisMovedThreshold = 50
DPadX = Axis::PovX
DPadY = Axis::PovY
LeftStickX = Axis::X
LeftStickY = Axis::Y
LeftTrigger = Axis::Z
RightStickX = Axis::U
RightStickY = Axis::V
RightTrigger = Axis::Z
Trigger = Axis::Z

NOTE Axis::Z is a combination of Left and Right Triggers, they cancel each other out

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def any_just_pressed?(id = 0) #

[View source]
def any_pressed?(id = 0) #

[View source]
def axis_just_moved_negative?(id : UInt32, axis : Axis) #

[View source]
def axis_just_moved_negative?(axis : Axis) #

[View source]
def axis_just_moved_positive?(id : UInt32, axis : Axis) #

[View source]
def axis_just_moved_positive?(axis : Axis) #

[View source]
def axis_moved(id : UInt32, axis : Axis, position : Float32) #

[View source]
def axis_moved?(id : UInt32, axis : Axis, amount : Number) #

[View source]
def axis_moved?(axis : Axis, amount : Number) #

[View source]
def axis_position(id : UInt32, axis : Axis) #

[View source]
def axis_position(axis : Axis) #

[View source]
def connect(id : UInt32) #

[View source]
def connected?(id : UInt32) #

[View source]
def d_pad_just_moved_down?(id : UInt32) #

[View source]
def d_pad_just_moved_down? #

[View source]
def d_pad_just_moved_left?(id : UInt32) #

[View source]
def d_pad_just_moved_left? #

[View source]
def d_pad_just_moved_right?(id : UInt32) #

[View source]
def d_pad_just_moved_right? #

[View source]
def d_pad_just_moved_up?(id : UInt32) #

[View source]
def d_pad_just_moved_up? #

[View source]
def d_pad_moved_down?(id : UInt32, amount : Number = AxisMovedThreshold) #

[View source]
def d_pad_moved_down?(amount : Number = AxisMovedThreshold) #

[View source]
def d_pad_moved_left?(id : UInt32, amount : Number = AxisMovedThreshold) #

[View source]
def d_pad_moved_left?(amount : Number = AxisMovedThreshold) #

[View source]
def d_pad_moved_right?(id : UInt32, amount : Number = AxisMovedThreshold) #

[View source]
def d_pad_moved_right?(amount : Number = AxisMovedThreshold) #

[View source]
def d_pad_moved_up?(id : UInt32, amount : Number = AxisMovedThreshold) #

[View source]
def d_pad_moved_up?(amount : Number = AxisMovedThreshold) #

[View source]
def disconnect(id : UInt32) #

[View source]
def just_pressed?(id : UInt32, button : Button) #

[View source]
def just_pressed?(id : UInt32, buttons : Array(Button)) #

[View source]
def just_pressed?(button : Button) #

[View source]
def just_pressed?(buttons : Array(Button)) #

[View source]
def left_stick_just_moved_down?(id : UInt32) #

[View source]
def left_stick_just_moved_down? #

[View source]
def left_stick_just_moved_left?(id : UInt32) #

[View source]
def left_stick_just_moved_left? #

[View source]
def left_stick_just_moved_right?(id : UInt32) #

[View source]
def left_stick_just_moved_right? #

[View source]
def left_stick_just_moved_up?(id : UInt32) #

[View source]
def left_stick_just_moved_up? #

[View source]
def left_stick_moved_down?(id : UInt32, amount : Number = AxisMovedThreshold) #

[View source]
def left_stick_moved_down?(amount : Number = AxisMovedThreshold) #

[View source]
def left_stick_moved_left?(id : UInt32, amount : Number = AxisMovedThreshold) #

[View source]
def left_stick_moved_left?(amount : Number = AxisMovedThreshold) #

[View source]
def left_stick_moved_right?(id : UInt32, amount : Number = AxisMovedThreshold) #

[View source]
def left_stick_moved_right?(amount : Number = AxisMovedThreshold) #

[View source]
def left_stick_moved_up?(id : UInt32, amount : Number = AxisMovedThreshold) #

[View source]
def left_stick_moved_up?(amount : Number = AxisMovedThreshold) #

[View source]
def pressed(id : UInt32, button : UInt32) #

[View source]
def pressed?(id : UInt32, button : Button) #

[View source]
def pressed?(id : UInt32, buttons : Array(Button)) #

[View source]
def pressed?(button : Button) #

[View source]
def pressed?(buttons : Array(Button)) #

[View source]
def released(id : UInt32, button : UInt32) #

[View source]
def reset #

[View source]
def right_stick_just_moved_down?(id : UInt32) #

[View source]
def right_stick_just_moved_down? #

[View source]
def right_stick_just_moved_left?(id : UInt32) #

[View source]
def right_stick_just_moved_left? #

[View source]
def right_stick_just_moved_right?(id : UInt32) #

[View source]
def right_stick_just_moved_right? #

[View source]
def right_stick_just_moved_up?(id : UInt32) #

[View source]
def right_stick_just_moved_up? #

[View source]
def right_stick_moved_down?(id : UInt32, amount : Number = AxisMovedThreshold) #

[View source]
def right_stick_moved_down?(amount : Number = AxisMovedThreshold) #

[View source]
def right_stick_moved_left?(id : UInt32, amount : Number = AxisMovedThreshold) #

[View source]
def right_stick_moved_left?(amount : Number = AxisMovedThreshold) #

[View source]
def right_stick_moved_right?(id : UInt32, amount : Number = AxisMovedThreshold) #

[View source]
def right_stick_moved_right?(amount : Number = AxisMovedThreshold) #

[View source]
def right_stick_moved_up?(id : UInt32, amount : Number = AxisMovedThreshold) #

[View source]
def right_stick_moved_up?(amount : Number = AxisMovedThreshold) #

[View source]