mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Improve Button API documentation in GenericHID (#2421)
This commit is contained in:
committed by
GitHub
parent
5854e284ea
commit
510936a2a0
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -62,6 +62,9 @@ class GenericHID : public ErrorBase {
|
||||
* the state of each button. The appropriate button is returned as a boolean
|
||||
* value.
|
||||
*
|
||||
* This method returns true if the button is being held down at the time
|
||||
* that this method is being called.
|
||||
*
|
||||
* @param button The button number to be read (starting at 1)
|
||||
* @return The state of the button.
|
||||
*/
|
||||
@@ -71,6 +74,10 @@ class GenericHID : public ErrorBase {
|
||||
* Whether the button was pressed since the last check. Button indexes begin
|
||||
* at 1.
|
||||
*
|
||||
* This method returns true if the button went from not pressed to held down
|
||||
* since the last time this method was called. This is useful if you only
|
||||
* want to call a function once when you press the button.
|
||||
*
|
||||
* @param button The button index, beginning at 1.
|
||||
* @return Whether the button was pressed since the last check.
|
||||
*/
|
||||
@@ -80,6 +87,10 @@ class GenericHID : public ErrorBase {
|
||||
* Whether the button was released since the last check. Button indexes begin
|
||||
* at 1.
|
||||
*
|
||||
* This method returns true if the button went from held down to not pressed
|
||||
* since the last time this method was called. This is useful if you only
|
||||
* want to call a function once when you release the button.
|
||||
*
|
||||
* @param button The button index, beginning at 1.
|
||||
* @return Whether the button was released since the last check.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user