Added functions for detecting button press and release events (#626)

I also shuffled around the HID interfaces to be more intuitive, deprecated some
Joystick and XboxController member functions, and deprecated the JoystickBase
and GamepadBase classes.

Supersedes #89.
This commit is contained in:
Tyler Veness
2017-10-27 21:45:56 -07:00
committed by Peter Johnson
parent c33fca34e9
commit 21585f70a8
17 changed files with 1334 additions and 724 deletions

View File

@@ -7,6 +7,8 @@
#pragma once
#include <support/deprecated.h>
#include "GenericHID.h"
namespace frc {
@@ -14,7 +16,8 @@ namespace frc {
/**
* Joystick Interface.
*/
class JoystickBase : public GenericHID {
class WPI_DEPRECATED("Inherit directly from GenericHID instead.") JoystickBase
: public GenericHID {
public:
explicit JoystickBase(int port);
virtual ~JoystickBase() = default;
@@ -22,9 +25,6 @@ class JoystickBase : public GenericHID {
virtual double GetZ(JoystickHand hand = kRightHand) const = 0;
virtual double GetTwist() const = 0;
virtual double GetThrottle() const = 0;
virtual bool GetTrigger(JoystickHand hand = kRightHand) const = 0;
virtual bool GetTop(JoystickHand hand = kRightHand) const = 0;
};
} // namespace frc