mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpilib] Add PS4Controller, remove Hand from GenericHID/XboxController (#3345)
- GenericHID is now concrete, and has only getRawAxis/Button(int) functionality - getXxx() has been moved into Joystick as that's the only place where it makes sense - Hand (and therefore getXxx(Hand)) has been removed, replaced by specific getLeft/RightXxx() methods in XboxController and the new PS4Controller class - C++ ::Button:: and ::Axis:: enums have been converted to identically-namespaced static constexpr ints
This commit is contained in:
37
wpilibc/src/test/native/cpp/PS4ControllerTest.cpp
Normal file
37
wpilibc/src/test/native/cpp/PS4ControllerTest.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "frc/PS4Controller.h" // NOLINT(build/include_order)
|
||||
|
||||
#include "JoystickTestMacros.h"
|
||||
#include "frc/simulation/PS4ControllerSim.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
BUTTON_TEST(PS4Controller, SquareButton)
|
||||
BUTTON_TEST(PS4Controller, CrossButton)
|
||||
BUTTON_TEST(PS4Controller, CircleButton)
|
||||
BUTTON_TEST(PS4Controller, TriangleButton)
|
||||
|
||||
BUTTON_TEST(PS4Controller, L1Button)
|
||||
BUTTON_TEST(PS4Controller, R1Button)
|
||||
BUTTON_TEST(PS4Controller, L2Button)
|
||||
BUTTON_TEST(PS4Controller, R2Button)
|
||||
|
||||
BUTTON_TEST(PS4Controller, ShareButton)
|
||||
BUTTON_TEST(PS4Controller, OptionsButton)
|
||||
|
||||
BUTTON_TEST(PS4Controller, L3Button)
|
||||
BUTTON_TEST(PS4Controller, R3Button)
|
||||
|
||||
BUTTON_TEST(PS4Controller, PSButton)
|
||||
BUTTON_TEST(PS4Controller, Touchpad)
|
||||
|
||||
AXIS_TEST(PS4Controller, LeftX)
|
||||
AXIS_TEST(PS4Controller, RightX)
|
||||
AXIS_TEST(PS4Controller, LeftY)
|
||||
AXIS_TEST(PS4Controller, RightY)
|
||||
AXIS_TEST(PS4Controller, L2Axis)
|
||||
AXIS_TEST(PS4Controller, R2Axis)
|
||||
Reference in New Issue
Block a user