Skip to content

Commit b24b605

Browse files
committed
fix button control formatting, add Mouse example
1 parent f83179e commit b24b605

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

Packages/com.unity.inputsystem/InputSystem/Controls/ButtonControl.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,11 @@ public bool wasPressedThisFrame
305305
/// </remarks>
306306
/// <example>
307307
/// <para>An example showing the use of this property on a gamepad button and a keyboard key:</para>
308-
///
308+
///
309309
/// <code>
310310
/// using UnityEngine;
311311
/// using UnityEngine.InputSystem;
312-
///
312+
///
313313
/// public class ExampleScript : MonoBehaviour
314314
/// {
315315
/// void Update()

Packages/com.unity.inputsystem/InputSystem/Devices/Mouse.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,31 @@ namespace UnityEngine.InputSystem
171171
/// An input device representing a mouse.
172172
/// </summary>
173173
/// <remarks>
174-
/// Adds a scroll wheel and a typical 5-button setup with a left, middle, right,
174+
/// Adds a scroll wheel and a typical 5-button setup with a left, middle, right,
175175
/// forward and backward button.
176176
///
177177
/// To control cursor display and behavior, use <see cref="UnityEngine.Cursor"/>.
178178
/// </remarks>
179+
/// <example>
180+
/// <para>An example showing the use of this property on a gamepad button and a keyboard key:</para>
181+
///
182+
/// <code>
183+
/// using UnityEngine;
184+
/// using UnityEngine.InputSystem;
185+
///
186+
/// public class ExampleScript : MonoBehaviour
187+
/// {
188+
/// void Update()
189+
/// {
190+
/// // If there is a current mouse and the left button was pressed
191+
/// if (Mouse.current != null && Mouse.current.leftButton.wasPressedThisFrame)
192+
/// {
193+
/// // handle left mouse button being pressed
194+
/// }
195+
/// }
196+
/// }
197+
/// </code>
198+
/// </example>
179199
/// <seealso cref="Pointer"/>
180200
[InputControlLayout(stateType = typeof(MouseState), isGenericTypeOfDevice = true)]
181201
public class Mouse : Pointer, IInputStateCallbackReceiver

0 commit comments

Comments
 (0)