glfw: add gamepad button IDs
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
98280d3be7
commit
d0be590230
2 changed files with 28 additions and 0 deletions
27
glfw/src/gamepad_button.zig
Normal file
27
glfw/src/gamepad_button.zig
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
//! Gamepad buttons.
|
||||||
|
//!
|
||||||
|
//! See glfw.getGamepadState for how these are used.
|
||||||
|
|
||||||
|
const c = @cImport(@cInclude("GLFW/glfw3.h"));
|
||||||
|
|
||||||
|
pub const a = C.GLFW_GAMEPAD_BUTTON_A;
|
||||||
|
pub const b = C.GLFW_GAMEPAD_BUTTON_B;
|
||||||
|
pub const x = C.GLFW_GAMEPAD_BUTTON_X;
|
||||||
|
pub const y = C.GLFW_GAMEPAD_BUTTON_Y;
|
||||||
|
pub const left_bumper = C.GLFW_GAMEPAD_BUTTON_LEFT_BUMPER;
|
||||||
|
pub const right_bumper = C.GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER;
|
||||||
|
pub const back = C.GLFW_GAMEPAD_BUTTON_BACK;
|
||||||
|
pub const start = C.GLFW_GAMEPAD_BUTTON_START;
|
||||||
|
pub const guide = C.GLFW_GAMEPAD_BUTTON_GUIDE;
|
||||||
|
pub const left_thumb = C.GLFW_GAMEPAD_BUTTON_LEFT_THUMB;
|
||||||
|
pub const right_thumb = C.GLFW_GAMEPAD_BUTTON_RIGHT_THUMB;
|
||||||
|
pub const dpad_up = C.GLFW_GAMEPAD_BUTTON_DPAD_UP;
|
||||||
|
pub const dpad_right = C.GLFW_GAMEPAD_BUTTON_DPAD_RIGHT;
|
||||||
|
pub const dpad_down = C.GLFW_GAMEPAD_BUTTON_DPAD_DOWN;
|
||||||
|
pub const dpad_left = C.GLFW_GAMEPAD_BUTTON_DPAD_LEFT;
|
||||||
|
pub const last = dpad_left;
|
||||||
|
|
||||||
|
pub const cross = a;
|
||||||
|
pub const circle = b;
|
||||||
|
pub const square = x;
|
||||||
|
pub const triangle = y;
|
||||||
|
|
@ -5,6 +5,7 @@ const c = @cImport(@cInclude("GLFW/glfw3.h"));
|
||||||
|
|
||||||
pub const action = @import("action.zig");
|
pub const action = @import("action.zig");
|
||||||
pub const gamepad_axis = @import("gamepad_axis.zig");
|
pub const gamepad_axis = @import("gamepad_axis.zig");
|
||||||
|
pub const gamepad_button = @import("gamepad_button.zig");
|
||||||
pub const hat = @import("hat.zig");
|
pub const hat = @import("hat.zig");
|
||||||
pub const joystick = @import("joystick.zig");
|
pub const joystick = @import("joystick.zig");
|
||||||
pub const key = @import("key.zig");
|
pub const key = @import("key.zig");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue