mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
Add method to get the port number of a Joystick (#137)
This commit is contained in:
committed by
Peter Johnson
parent
73602e6cb4
commit
b036bf2e34
@@ -95,6 +95,7 @@ class Joystick : public GenericHID, public ErrorBase {
|
||||
bool GetIsXbox() const;
|
||||
Joystick::HIDType GetType() const;
|
||||
std::string GetName() const;
|
||||
int GetPort() const;
|
||||
int GetAxisType(uint8_t axis) const;
|
||||
|
||||
int GetAxisCount() const;
|
||||
|
||||
@@ -277,6 +277,13 @@ Joystick::HIDType Joystick::GetType() const {
|
||||
*/
|
||||
std::string Joystick::GetName() const { return m_ds.GetJoystickName(m_port); }
|
||||
|
||||
/**
|
||||
* Get the port number of the joystick.
|
||||
*
|
||||
* @return The port number of the joystick.
|
||||
*/
|
||||
int Joystick::GetPort() const { return m_port; }
|
||||
|
||||
// int Joystick::GetAxisType(uint8_t axis) const
|
||||
//{
|
||||
// return m_ds.GetJoystickAxisType(m_port, axis);
|
||||
|
||||
@@ -446,6 +446,15 @@ public class Joystick extends GenericHID {
|
||||
return m_ds.getJoystickName(m_port);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the port number of the joystick.
|
||||
*
|
||||
* @return The port number of the joystick.
|
||||
*/
|
||||
public int getPort() {
|
||||
return m_port;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the rumble output for the joystick. The DS currently supports 2 rumble values, left rumble
|
||||
* and right rumble.
|
||||
|
||||
Reference in New Issue
Block a user