Skip to content

Commit f83179e

Browse files
committed
update
1 parent cd53351 commit f83179e

File tree

2 files changed

+24
-25
lines changed

2 files changed

+24
-25
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public class ButtonControl : AxisControl
3434
/// <summary>
3535
/// The minimum value the button has to reach for it to be considered pressed.
3636
/// </summary>
37-
/// <value>Button press threshold.</value>
3837
/// <remarks>
3938
/// The button is considered pressed, if it has a value equal to or greater than
4039
/// this value.
@@ -64,7 +63,6 @@ public class ButtonControl : AxisControl
6463
/// <summary>
6564
/// Return <see cref="pressPoint"/> if set, otherwise return <see cref="InputSettings.defaultButtonPressPoint"/>.
6665
/// </summary>
67-
/// <value>Effective value to use for press point thresholds.</value>
6866
public float pressPointOrDefault => pressPoint > 0 ? pressPoint : s_GlobalDefaultButtonPressPoint;
6967

7068
/// <summary>
@@ -143,7 +141,6 @@ public ButtonControl()
143141
/// <summary>
144142
/// Whether the button is currently pressed.
145143
/// </summary>
146-
/// <value>True if button is currently pressed.</value>
147144
/// <remarks>
148145
/// A button is considered pressed if its value is equal to or greater
149146
/// than its button press threshold (<see cref="pressPointOrDefault"/>).
@@ -242,7 +239,6 @@ private void BeginTestingForFramePresses(bool currentlyPressed, bool pressedLast
242239
/// <summary>
243240
/// Whether the press started this frame.
244241
/// </summary>
245-
/// <value>True if the current press of the button started this frame.</value>
246242
/// <remarks>
247243
/// The first time this function - or wasReleasedThisFrame - are called, it's possible that extremely fast
248244
/// inputs (or very slow frame update times) will result in presses/releases being missed.
@@ -304,16 +300,16 @@ public bool wasPressedThisFrame
304300
/// <summary>
305301
/// Whether the press ended this frame.
306302
/// </summary>
307-
/// <value>True if the current press of the button ended this frame.</value>
308303
/// <remarks>
309304
/// _Note_: The Input System identifies keys by physical layout, not according to the current language mapping of the keyboard. To query the name of the key according to the language mapping, use <see cref="InputControl.displayName"/>.
310305
/// </remarks>
311306
/// <example>
312307
/// <para>An example showing the use of this property on a gamepad button and a keyboard key:</para>
308+
///
313309
/// <code>
314310
/// using UnityEngine;
315311
/// using UnityEngine.InputSystem;
316-
///
312+
///
317313
/// public class ExampleScript : MonoBehaviour
318314
/// {
319315
/// void Update()

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

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -171,18 +171,18 @@ namespace UnityEngine.InputSystem
171171
/// An input device representing a mouse.
172172
/// </summary>
173173
/// <remarks>
174-
/// Adds a scroll wheel and a typical 3-button setup with a left, middle, and right
175-
/// button.
174+
/// Adds a scroll wheel and a typical 5-button setup with a left, middle, right,
175+
/// forward and backward button.
176176
///
177177
/// To control cursor display and behavior, use <see cref="UnityEngine.Cursor"/>.
178178
/// </remarks>
179+
/// <seealso cref="Pointer"/>
179180
[InputControlLayout(stateType = typeof(MouseState), isGenericTypeOfDevice = true)]
180181
public class Mouse : Pointer, IInputStateCallbackReceiver
181182
{
182183
/// <summary>
183-
/// The horizontal and vertical scroll wheels.
184+
/// Control representing horizontal and vertical scroll wheels of a Mouse device.
184185
/// </summary>
185-
/// <value>Control representing the mouse scroll wheels.</value>
186186
/// <remarks>
187187
/// The <c>x</c> component corresponds to the horizontal scroll wheel, the
188188
/// <c>y</c> component to the vertical scroll wheel. Most mice do not have
@@ -191,58 +191,57 @@ public class Mouse : Pointer, IInputStateCallbackReceiver
191191
public DeltaControl scroll { get; protected set; }
192192

193193
/// <summary>
194-
/// The left mouse button.
194+
/// Control representing left button of a Mouse device.
195195
/// </summary>
196-
/// <value>Control representing the left mouse button.</value>
197196
public ButtonControl leftButton { get; protected set; }
198197

199198
/// <summary>
200-
/// The middle mouse button.
199+
/// Control representing middle button of a Mouse device.
201200
/// </summary>
202-
/// <value>Control representing the middle mouse button.</value>
203201
public ButtonControl middleButton { get; protected set; }
204202

205203
/// <summary>
206-
/// The right mouse button.
204+
/// Control representing right button of a Mouse device.
207205
/// </summary>
208-
/// <value>Control representing the right mouse button.</value>
209206
public ButtonControl rightButton { get; protected set; }
210207

211208
/// <summary>
212-
/// The first side button, often labeled/used as "back".
209+
/// Control representing the first side button, often labeled/used as "back", of a Mouse device.
213210
/// </summary>
214-
/// <value>Control representing the back button on the mouse.</value>
215211
/// <remarks>
216212
/// On Windows, this corresponds to <c>RI_MOUSE_BUTTON_4</c>.
217213
/// </remarks>
218214
public ButtonControl backButton { get; protected set; }
219215

220216
/// <summary>
221-
/// The second side button, often labeled/used as "forward".
217+
/// Control representing the second side button, often labeled/used as "forward", of a Mouse device.
222218
/// </summary>
223-
/// <value>Control representing the forward button on the mouse.</value>
224219
/// <remarks>
225220
/// On Windows, this corresponds to <c>RI_MOUSE_BUTTON_5</c>.
226221
/// </remarks>
227222
public ButtonControl forwardButton { get; protected set; }
228223

229224
/// <summary>
230-
/// Number of times any of the mouse buttons has been clicked in succession within
225+
/// Control representing the number of times any of the mouse buttons has been clicked in succession within
231226
/// the system-defined click time threshold.
232227
/// </summary>
233-
/// <value>Control representing the mouse click count.</value>
234228
public IntegerControl clickCount { get; protected set; }
235229

236230
/// <summary>
237231
/// The mouse that was added or updated last or null if there is no mouse
238232
/// connected to the system.
239233
/// </summary>
240-
/// <seealso cref="InputDevice.MakeCurrent"/>
234+
/// <remarks>
235+
/// To set a mouse device as current, use <see cref="Mouse.MakeCurrent"/>.
236+
/// </remarks>
241237
public new static Mouse current { get; private set; }
242238

243239
/// <summary>
244240
/// Called when the mouse becomes the current mouse.
245241
/// </summary>
242+
/// <remarks>
243+
/// This is called automatically by the system when there is input on a connected mouse.
244+
/// </remarks>
246245
public override void MakeCurrent()
247246
{
248247
base.MakeCurrent();
@@ -274,7 +273,9 @@ protected override void OnRemoved()
274273

275274
////REVIEW: how should we handle this being called from EditorWindow's? (where the editor window space processor will turn coordinates automatically into editor window space)
276275
/// <summary>
277-
/// Move the operating system's mouse cursor.
276+
/// Move the operating system's mouse cursor by performing a device command in a similar way to <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa363216%28v=vs.85%29.aspx?f=255&amp;MSPPError=-2147217396" target="_blank">
277+
/// DeviceIoControl</a> on Windows and <a href="https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/ioctl.2.html#//apple_ref/doc/man/2/ioctl" target="_blank">ioctl</a>
278+
/// on UNIX-like systems.
278279
/// </summary>
279280
/// <param name="position">New position in player window space.</param>
280281
/// <remarks>
@@ -313,7 +314,9 @@ protected override void FinishSetup()
313314
/// <summary>
314315
/// Implements <see cref="IInputStateCallbackReceiver.OnStateEvent"/> for the mouse.
315316
/// </summary>
316-
/// <param name="eventPtr"></param>
317+
/// <param name="eventPtr">Pointer to an <see cref="InputEvent"/>. Makes it easier to
318+
/// work with InputEvents and hides the unsafe operations necessary to work with them.
319+
/// </param>
317320
protected new unsafe void OnStateEvent(InputEventPtr eventPtr)
318321
{
319322
scroll.AccumulateValueInEvent(currentStatePtr, eventPtr);

0 commit comments

Comments
 (0)