class Glint::Input::Controller::Controller
- Glint::Input::Controller::Controller
- Reference
- Object
Defined in:
glint/input/controller.crConstructors
-
.new(id : Int32)
Creates a
Controller.
Class Method Summary
-
.available?(id)
Returns whether the specified controller is available.
-
.name(id)
Returns the name of the specified controller.
Instance Method Summary
-
#available?
Returns whether the controller is available.
-
#id : Int32
Returns the
Controller's id. -
#is_down?(button : Button) : Bool
Returns whether the
Controller::Buttonis in the down state. -
#is_left_face_down_down?
Returns whether the
Button::LeftFaceDownis in the down state. -
#is_left_face_down_pressed?
Returns whether the
Button::LeftFaceDownis in the pressed state. -
#is_left_face_down_released?
Returns whether the
Button::LeftFaceDownis in the released state. -
#is_left_face_down_up?
Returns whether the
Button::LeftFaceDownis in the up state. -
#is_left_face_left_down?
Returns whether the
Button::LeftFaceLeftis in the down state. -
#is_left_face_left_pressed?
Returns whether the
Button::LeftFaceLeftis in the pressed state. -
#is_left_face_left_released?
Returns whether the
Button::LeftFaceLeftis in the released state. -
#is_left_face_left_up?
Returns whether the
Button::LeftFaceLeftis in the up state. -
#is_left_face_right_down?
Returns whether the
Button::LeftFaceRightis in the down state. -
#is_left_face_right_pressed?
Returns whether the
Button::LeftFaceRightis in the pressed state. -
#is_left_face_right_released?
Returns whether the
Button::LeftFaceRightis in the released state. -
#is_left_face_right_up?
Returns whether the
Button::LeftFaceRightis in the up state. -
#is_left_face_up_down?
Returns whether the
Button::LeftFaceUpis in the down state. -
#is_left_face_up_pressed?
Returns whether the
Button::LeftFaceUpis in the pressed state. -
#is_left_face_up_released?
Returns whether the
Button::LeftFaceUpis in the released state. -
#is_left_face_up_up?
Returns whether the
Button::LeftFaceUpis in the up state. -
#is_left_thumb_down?
Returns whether the
Button::LeftThumbis in the down state. -
#is_left_thumb_pressed?
Returns whether the
Button::LeftThumbis in the pressed state. -
#is_left_thumb_released?
Returns whether the
Button::LeftThumbis in the released state. -
#is_left_thumb_up?
Returns whether the
Button::LeftThumbis in the up state. -
#is_left_trigger_1_down?
Returns whether the
Button::LeftTrigger1is in the down state. -
#is_left_trigger_1_pressed?
Returns whether the
Button::LeftTrigger1is in the pressed state. -
#is_left_trigger_1_released?
Returns whether the
Button::LeftTrigger1is in the released state. -
#is_left_trigger_1_up?
Returns whether the
Button::LeftTrigger1is in the up state. -
#is_left_trigger_2_down?
Returns whether the
Button::LeftTrigger2is in the down state. -
#is_left_trigger_2_pressed?
Returns whether the
Button::LeftTrigger2is in the pressed state. -
#is_left_trigger_2_released?
Returns whether the
Button::LeftTrigger2is in the released state. -
#is_left_trigger_2_up?
Returns whether the
Button::LeftTrigger2is in the up state. -
#is_middle_down?
Returns whether the
Button::Middleis in the down state. -
#is_middle_left_down?
Returns whether the
Button::MiddleLeftis in the down state. -
#is_middle_left_pressed?
Returns whether the
Button::MiddleLeftis in the pressed state. -
#is_middle_left_released?
Returns whether the
Button::MiddleLeftis in the released state. -
#is_middle_left_up?
Returns whether the
Button::MiddleLeftis in the up state. -
#is_middle_pressed?
Returns whether the
Button::Middleis in the pressed state. -
#is_middle_released?
Returns whether the
Button::Middleis in the released state. -
#is_middle_right_down?
Returns whether the
Button::MiddleRightis in the down state. -
#is_middle_right_pressed?
Returns whether the
Button::MiddleRightis in the pressed state. -
#is_middle_right_released?
Returns whether the
Button::MiddleRightis in the released state. -
#is_middle_right_up?
Returns whether the
Button::MiddleRightis in the up state. -
#is_middle_up?
Returns whether the
Button::Middleis in the up state. -
#is_pressed?(button : Button) : Bool
Returns whether the
Controller::Buttonis in the pressed state. -
#is_released?(button : Button) : Bool
Returns whether the
Controller::Buttonis in the released state. -
#is_right_face_down_down?
Returns whether the
Button::RightFaceDownis in the down state. -
#is_right_face_down_pressed?
Returns whether the
Button::RightFaceDownis in the pressed state. -
#is_right_face_down_released?
Returns whether the
Button::RightFaceDownis in the released state. -
#is_right_face_down_up?
Returns whether the
Button::RightFaceDownis in the up state. -
#is_right_face_left_down?
Returns whether the
Button::RightFaceLeftis in the down state. -
#is_right_face_left_pressed?
Returns whether the
Button::RightFaceLeftis in the pressed state. -
#is_right_face_left_released?
Returns whether the
Button::RightFaceLeftis in the released state. -
#is_right_face_left_up?
Returns whether the
Button::RightFaceLeftis in the up state. -
#is_right_face_right_down?
Returns whether the
Button::RightFaceRightis in the down state. -
#is_right_face_right_pressed?
Returns whether the
Button::RightFaceRightis in the pressed state. -
#is_right_face_right_released?
Returns whether the
Button::RightFaceRightis in the released state. -
#is_right_face_right_up?
Returns whether the
Button::RightFaceRightis in the up state. -
#is_right_face_up_down?
Returns whether the
Button::RightFaceUpis in the down state. -
#is_right_face_up_pressed?
Returns whether the
Button::RightFaceUpis in the pressed state. -
#is_right_face_up_released?
Returns whether the
Button::RightFaceUpis in the released state. -
#is_right_face_up_up?
Returns whether the
Button::RightFaceUpis in the up state. -
#is_right_thumb_down?
Returns whether the
Button::RightThumbis in the down state. -
#is_right_thumb_pressed?
Returns whether the
Button::RightThumbis in the pressed state. -
#is_right_thumb_released?
Returns whether the
Button::RightThumbis in the released state. -
#is_right_thumb_up?
Returns whether the
Button::RightThumbis in the up state. -
#is_right_trigger_1_down?
Returns whether the
Button::RightTrigger1is in the down state. -
#is_right_trigger_1_pressed?
Returns whether the
Button::RightTrigger1is in the pressed state. -
#is_right_trigger_1_released?
Returns whether the
Button::RightTrigger1is in the released state. -
#is_right_trigger_1_up?
Returns whether the
Button::RightTrigger1is in the up state. -
#is_right_trigger_2_down?
Returns whether the
Button::RightTrigger2is in the down state. -
#is_right_trigger_2_pressed?
Returns whether the
Button::RightTrigger2is in the pressed state. -
#is_right_trigger_2_released?
Returns whether the
Button::RightTrigger2is in the released state. -
#is_right_trigger_2_up?
Returns whether the
Button::RightTrigger2is in the up state. -
#is_unknown_down?
Returns whether the
Button::Unknownis in the down state. -
#is_unknown_pressed?
Returns whether the
Button::Unknownis in the pressed state. -
#is_unknown_released?
Returns whether the
Button::Unknownis in the released state. -
#is_unknown_up?
Returns whether the
Button::Unknownis in the up state. -
#is_up?(button : Button) : Bool
Returns whether the
Controller::Buttonis in the up state. -
#name
Returns the name of the
Controller.
Constructor Detail
Class Method Detail
Instance Method Detail
Returns whether the Controller::Button is in the down state.
def is_down?(button : Button) : Bool
return false unless available?
button.is_down? @id
end
Returns whether the Button::LeftFaceDown is in the down state.
def is_left_face_down_down?
return false unless available?
Button::LeftFaceDown.is_down? self
end
Returns whether the Button::LeftFaceDown is in the pressed state.
def is_left_face_down_pressed?
return false unless available?
Button::LeftFaceDown.is_pressed? self
end
Returns whether the Button::LeftFaceDown is in the released state.
def is_left_face_down_released?
return false unless available?
Button::LeftFaceDown.is_released? self
end
Returns whether the Button::LeftFaceDown is in the up state.
def is_left_face_down_up?
return false unless available?
Button::LeftFaceDown.is_up? self
end
Returns whether the Button::LeftFaceLeft is in the down state.
def is_left_face_left_down?
return false unless available?
Button::LeftFaceLeft.is_down? self
end
Returns whether the Button::LeftFaceLeft is in the pressed state.
def is_left_face_left_pressed?
return false unless available?
Button::LeftFaceLeft.is_pressed? self
end
Returns whether the Button::LeftFaceLeft is in the released state.
def is_left_face_left_released?
return false unless available?
Button::LeftFaceLeft.is_released? self
end
Returns whether the Button::LeftFaceLeft is in the up state.
def is_left_face_left_up?
return false unless available?
Button::LeftFaceLeft.is_up? self
end
Returns whether the Button::LeftFaceRight is in the down state.
def is_left_face_right_down?
return false unless available?
Button::LeftFaceRight.is_down? self
end
Returns whether the Button::LeftFaceRight is in the pressed state.
def is_left_face_right_pressed?
return false unless available?
Button::LeftFaceRight.is_pressed? self
end
Returns whether the Button::LeftFaceRight is in the released state.
def is_left_face_right_released?
return false unless available?
Button::LeftFaceRight.is_released? self
end
Returns whether the Button::LeftFaceRight is in the up state.
def is_left_face_right_up?
return false unless available?
Button::LeftFaceRight.is_up? self
end
Returns whether the Button::LeftFaceUp is in the down state.
def is_left_face_up_down?
return false unless available?
Button::LeftFaceUp.is_down? self
end
Returns whether the Button::LeftFaceUp is in the pressed state.
def is_left_face_up_pressed?
return false unless available?
Button::LeftFaceUp.is_pressed? self
end
Returns whether the Button::LeftFaceUp is in the released state.
def is_left_face_up_released?
return false unless available?
Button::LeftFaceUp.is_released? self
end
Returns whether the Button::LeftFaceUp is in the up state.
def is_left_face_up_up?
return false unless available?
Button::LeftFaceUp.is_up? self
end
Returns whether the Button::LeftThumb is in the down state.
def is_left_thumb_down?
return false unless available?
Button::LeftThumb.is_down? self
end
Returns whether the Button::LeftThumb is in the pressed state.
def is_left_thumb_pressed?
return false unless available?
Button::LeftThumb.is_pressed? self
end
Returns whether the Button::LeftThumb is in the released state.
def is_left_thumb_released?
return false unless available?
Button::LeftThumb.is_released? self
end
Returns whether the Button::LeftThumb is in the up state.
def is_left_thumb_up?
return false unless available?
Button::LeftThumb.is_up? self
end
Returns whether the Button::LeftTrigger1 is in the down state.
def is_left_trigger_1_down?
return false unless available?
Button::LeftTrigger1.is_down? self
end
Returns whether the Button::LeftTrigger1 is in the pressed state.
def is_left_trigger_1_pressed?
return false unless available?
Button::LeftTrigger1.is_pressed? self
end
Returns whether the Button::LeftTrigger1 is in the released state.
def is_left_trigger_1_released?
return false unless available?
Button::LeftTrigger1.is_released? self
end
Returns whether the Button::LeftTrigger1 is in the up state.
def is_left_trigger_1_up?
return false unless available?
Button::LeftTrigger1.is_up? self
end
Returns whether the Button::LeftTrigger2 is in the down state.
def is_left_trigger_2_down?
return false unless available?
Button::LeftTrigger2.is_down? self
end
Returns whether the Button::LeftTrigger2 is in the pressed state.
def is_left_trigger_2_pressed?
return false unless available?
Button::LeftTrigger2.is_pressed? self
end
Returns whether the Button::LeftTrigger2 is in the released state.
def is_left_trigger_2_released?
return false unless available?
Button::LeftTrigger2.is_released? self
end
Returns whether the Button::LeftTrigger2 is in the up state.
def is_left_trigger_2_up?
return false unless available?
Button::LeftTrigger2.is_up? self
end
Returns whether the Button::Middle is in the down state.
def is_middle_down?
return false unless available?
Button::Middle.is_down? self
end
Returns whether the Button::MiddleLeft is in the down state.
def is_middle_left_down?
return false unless available?
Button::MiddleLeft.is_down? self
end
Returns whether the Button::MiddleLeft is in the pressed state.
def is_middle_left_pressed?
return false unless available?
Button::MiddleLeft.is_pressed? self
end
Returns whether the Button::MiddleLeft is in the released state.
def is_middle_left_released?
return false unless available?
Button::MiddleLeft.is_released? self
end
Returns whether the Button::MiddleLeft is in the up state.
def is_middle_left_up?
return false unless available?
Button::MiddleLeft.is_up? self
end
Returns whether the Button::Middle is in the pressed state.
def is_middle_pressed?
return false unless available?
Button::Middle.is_pressed? self
end
Returns whether the Button::Middle is in the released state.
def is_middle_released?
return false unless available?
Button::Middle.is_released? self
end
Returns whether the Button::MiddleRight is in the down state.
def is_middle_right_down?
return false unless available?
Button::MiddleRight.is_down? self
end
Returns whether the Button::MiddleRight is in the pressed state.
def is_middle_right_pressed?
return false unless available?
Button::MiddleRight.is_pressed? self
end
Returns whether the Button::MiddleRight is in the released state.
def is_middle_right_released?
return false unless available?
Button::MiddleRight.is_released? self
end
Returns whether the Button::MiddleRight is in the up state.
def is_middle_right_up?
return false unless available?
Button::MiddleRight.is_up? self
end
Returns whether the Button::Middle is in the up state.
def is_middle_up?
return false unless available?
Button::Middle.is_up? self
end
Returns whether the Controller::Button is in the pressed state.
def is_pressed?(button : Button) : Bool
return false unless available?
button.is_pressed? @id
end
Returns whether the Controller::Button is in the released state.
def is_released?(button : Button) : Bool
return false unless available?
button.is_released? @id
end
Returns whether the Button::RightFaceDown is in the down state.
def is_right_face_down_down?
return false unless available?
Button::RightFaceDown.is_down? self
end
Returns whether the Button::RightFaceDown is in the pressed state.
def is_right_face_down_pressed?
return false unless available?
Button::RightFaceDown.is_pressed? self
end
Returns whether the Button::RightFaceDown is in the released state.
def is_right_face_down_released?
return false unless available?
Button::RightFaceDown.is_released? self
end
Returns whether the Button::RightFaceDown is in the up state.
def is_right_face_down_up?
return false unless available?
Button::RightFaceDown.is_up? self
end
Returns whether the Button::RightFaceLeft is in the down state.
def is_right_face_left_down?
return false unless available?
Button::RightFaceLeft.is_down? self
end
Returns whether the Button::RightFaceLeft is in the pressed state.
def is_right_face_left_pressed?
return false unless available?
Button::RightFaceLeft.is_pressed? self
end
Returns whether the Button::RightFaceLeft is in the released state.
def is_right_face_left_released?
return false unless available?
Button::RightFaceLeft.is_released? self
end
Returns whether the Button::RightFaceLeft is in the up state.
def is_right_face_left_up?
return false unless available?
Button::RightFaceLeft.is_up? self
end
Returns whether the Button::RightFaceRight is in the down state.
def is_right_face_right_down?
return false unless available?
Button::RightFaceRight.is_down? self
end
Returns whether the Button::RightFaceRight is in the pressed state.
def is_right_face_right_pressed?
return false unless available?
Button::RightFaceRight.is_pressed? self
end
Returns whether the Button::RightFaceRight is in the released state.
def is_right_face_right_released?
return false unless available?
Button::RightFaceRight.is_released? self
end
Returns whether the Button::RightFaceRight is in the up state.
def is_right_face_right_up?
return false unless available?
Button::RightFaceRight.is_up? self
end
Returns whether the Button::RightFaceUp is in the down state.
def is_right_face_up_down?
return false unless available?
Button::RightFaceUp.is_down? self
end
Returns whether the Button::RightFaceUp is in the pressed state.
def is_right_face_up_pressed?
return false unless available?
Button::RightFaceUp.is_pressed? self
end
Returns whether the Button::RightFaceUp is in the released state.
def is_right_face_up_released?
return false unless available?
Button::RightFaceUp.is_released? self
end
Returns whether the Button::RightFaceUp is in the up state.
def is_right_face_up_up?
return false unless available?
Button::RightFaceUp.is_up? self
end
Returns whether the Button::RightThumb is in the down state.
def is_right_thumb_down?
return false unless available?
Button::RightThumb.is_down? self
end
Returns whether the Button::RightThumb is in the pressed state.
def is_right_thumb_pressed?
return false unless available?
Button::RightThumb.is_pressed? self
end
Returns whether the Button::RightThumb is in the released state.
def is_right_thumb_released?
return false unless available?
Button::RightThumb.is_released? self
end
Returns whether the Button::RightThumb is in the up state.
def is_right_thumb_up?
return false unless available?
Button::RightThumb.is_up? self
end
Returns whether the Button::RightTrigger1 is in the down state.
def is_right_trigger_1_down?
return false unless available?
Button::RightTrigger1.is_down? self
end
Returns whether the Button::RightTrigger1 is in the pressed state.
def is_right_trigger_1_pressed?
return false unless available?
Button::RightTrigger1.is_pressed? self
end
Returns whether the Button::RightTrigger1 is in the released state.
def is_right_trigger_1_released?
return false unless available?
Button::RightTrigger1.is_released? self
end
Returns whether the Button::RightTrigger1 is in the up state.
def is_right_trigger_1_up?
return false unless available?
Button::RightTrigger1.is_up? self
end
Returns whether the Button::RightTrigger2 is in the down state.
def is_right_trigger_2_down?
return false unless available?
Button::RightTrigger2.is_down? self
end
Returns whether the Button::RightTrigger2 is in the pressed state.
def is_right_trigger_2_pressed?
return false unless available?
Button::RightTrigger2.is_pressed? self
end
Returns whether the Button::RightTrigger2 is in the released state.
def is_right_trigger_2_released?
return false unless available?
Button::RightTrigger2.is_released? self
end
Returns whether the Button::RightTrigger2 is in the up state.
def is_right_trigger_2_up?
return false unless available?
Button::RightTrigger2.is_up? self
end
Returns whether the Button::Unknown is in the down state.
def is_unknown_down?
return false unless available?
Button::Unknown.is_down? self
end
Returns whether the Button::Unknown is in the pressed state.
def is_unknown_pressed?
return false unless available?
Button::Unknown.is_pressed? self
end
Returns whether the Button::Unknown is in the released state.
def is_unknown_released?
return false unless available?
Button::Unknown.is_released? self
end
Returns whether the Button::Unknown is in the up state.
def is_unknown_up?
return false unless available?
Button::Unknown.is_up? self
end
Returns whether the Controller::Button is in the up state.
def is_up?(button : Button) : Bool
return false unless available?
button.is_up? @id
end