add bindings to query gamepad's face buttons
This commit is contained in:
@@ -66,3 +66,27 @@ float getLeftJoystickYAxisState() {
|
||||
return 99.0;
|
||||
}
|
||||
}
|
||||
|
||||
int isCrossButtonPressed() {
|
||||
return state.buttons[GLFW_GAMEPAD_BUTTON_CROSS];
|
||||
}
|
||||
|
||||
int isCircleButtonPressed() {
|
||||
return state.buttons[GLFW_GAMEPAD_BUTTON_CIRCLE];
|
||||
}
|
||||
|
||||
int isSquareButtonPressed() {
|
||||
return state.buttons[GLFW_GAMEPAD_BUTTON_SQUARE];
|
||||
}
|
||||
|
||||
int isTriangleButtonPressed() {
|
||||
return state.buttons[GLFW_GAMEPAD_BUTTON_TRIANGLE];
|
||||
}
|
||||
|
||||
int isR1ButtonPressed() {
|
||||
return state.buttons[GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER];
|
||||
}
|
||||
|
||||
int isL1ButtonPressed() {
|
||||
return state.buttons[GLFW_GAMEPAD_BUTTON_LEFT_BUMPER];
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ struct
|
||||
_symbol "KEY_ARROW_DOWN" public : ( unit -> int ) * ( int -> unit );
|
||||
val KEY_ARROW_DOWN = KEY_ARROW_DOWN ()
|
||||
|
||||
(* gamepad bindings below *)
|
||||
val getGamepadState =
|
||||
_import "getGamepadState" public : int -> unit;
|
||||
|
||||
@@ -60,4 +61,17 @@ struct
|
||||
_import "getLeftJoystickXAxisState" public : unit -> Real32.real;
|
||||
val getLeftJoystickYAxisState =
|
||||
_import "getLeftJoystickYAxisState" public : unit -> Real32.real;
|
||||
|
||||
val isCrossButtonPressed =
|
||||
_import "isCrossButtonPressed" public : unit -> int;
|
||||
val isCircleButtonPressed =
|
||||
_import "isCircleButtonPressed" public : unit -> int;
|
||||
val isSquareButtonPressed =
|
||||
_import "isSquareButtonPressed" public : unit -> int;
|
||||
val isTriangleButtonPressed =
|
||||
_import "isTriangleButtonPressed" public : unit -> int;
|
||||
val isR1ButtonPressed =
|
||||
_import "isR1ButtonPressed" public : unit -> int;
|
||||
val isL1ButtonPressed =
|
||||
_import "isL1ButtonPressed" public : unit -> int;
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user