Swanium::Frontend::InputBindings
Inherits Reference < Object
Keyboard bindings are SDL scancodes, so they remain layout-independent.
Constants
ACTIONS = [:x1, :x2, :x3, :x4, :y1, :y2, :y3, :y4, :a, :b, :start]
CONTROLLER_BUTTON_OPTIONS = [{"A", 0}, {"B", 1}, {"X", 2}, {"Y", 3}, {"Back", 4}, {"Start", 6}, {"Left Shoulder", 9}, {"Right Shoulder", 10}]
DEFAULTS = {
x1: 82, x2: 79, x3: 81, x4: 80,
y1: 26, y2: 7, y3: 22, y4: 4,
a: 27, b: 29, start: 40,
}
OPTIONS = [{"Arrow Up", 82}, {"Arrow Right", 79}, {"Arrow Down", 81}, {"Arrow Left", 80}, {"W", 26}, {"A", 4}, {"S", 22}, {"D", 7}, {"X", 27}, {"Z", 29}, {"Return", 40}, {"Space", 44}]
Constructors
default
Sourcenew
SourceClass methods
action_label(action : Symbol) : String
Sourcecontroller_button_index(button : Int32) : Int32
Sourcecontroller_button_name(button : Int32) : String
Sourcecontroller_button_names
Sourcecontroller_button_value(index : Int32) : Int32
Sourceoption_index(scancode : Int32) : Int32
Sourceoption_name(scancode : Int32) : String
Sourceoption_names
Sourceoption_scancode(index : Int32) : Int32
SourceInstance methods
controller_button(action : Symbol) : Int32
Sourcecontroller_destination(name : String, default : Int32) : Int32
0 = disabled, 1 = X pad, 2 = Y pad.
controller_enabled?(name : String, default : Bool = true) : Bool
Sourcereset_controller
Sourcereset_keyboard
Sourcescancode(action : Symbol) : Int32
Sourceset(action : Symbol, scancode : Int32) : Nil
Sourceset_controller_button(action : Symbol, button : Int32) : Nil
Sourceset_controller_destination(name : String, destination : Int32) : Nil
Sourceset_controller_enabled(name : String, enabled : Bool) : Nil
Source