mirror of
https://github.com/bevyengine/bevy
synced 2024-12-21 02:23:08 +00:00
19d4694d24
Co-authored-by: Carter Anderson <mcanders1@gmail.com>
52 lines
1 KiB
Rust
52 lines
1 KiB
Rust
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
|
pub struct Gamepad(pub usize);
|
|
|
|
#[derive(Debug, Copy, Clone, PartialEq)]
|
|
pub enum GamepadEventType {
|
|
Connected,
|
|
Disconnected,
|
|
}
|
|
|
|
#[derive(Debug, Copy, Clone, PartialEq)]
|
|
pub struct GamepadEvent(pub Gamepad, pub GamepadEventType);
|
|
|
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
|
pub enum GamepadButtonType {
|
|
South,
|
|
East,
|
|
North,
|
|
West,
|
|
C,
|
|
Z,
|
|
LeftTrigger,
|
|
LeftTrigger2,
|
|
RightTrigger,
|
|
RightTrigger2,
|
|
Select,
|
|
Start,
|
|
Mode,
|
|
LeftThumb,
|
|
RightThumb,
|
|
DPadUp,
|
|
DPadDown,
|
|
DPadLeft,
|
|
DPadRight,
|
|
}
|
|
|
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
|
pub struct GamepadButton(pub Gamepad, pub GamepadButtonType);
|
|
|
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
|
pub enum GamepadAxisType {
|
|
LeftStickX,
|
|
LeftStickY,
|
|
LeftZ,
|
|
RightStickX,
|
|
RightStickY,
|
|
RightZ,
|
|
DPadX,
|
|
DPadY,
|
|
}
|
|
|
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
|
pub struct GamepadAxis(pub Gamepad, pub GamepadAxisType);
|