-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOCS: Update Keyboard documentation #2069
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code examples are not compiling if you copy paste them into an empty script.
Also, I'm not sure if the protected
methods would need a proper example (like OnAdded
).
Unless users could use them as well out of the box. Maybe they can and I would just need to see if the code example compiles.
@@ -1006,6 +1034,25 @@ public event Action<IMECompositionString> onIMECompositionChange | |||
/// See <see cref="Keyboard.SetIMECursorPosition"/>, <see cref="Keyboard.onIMECompositionChange"/>, | |||
/// <see cref="Keyboard.imeSelected"/> for more IME settings and data. | |||
/// </remarks> | |||
/// <param name="enabled"> | |||
/// The new IME composition enabled state. True to enable the IME, false to disable it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should "the new" be removed and instead just use "The IME composition..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I believe true and false when referencing keywords or identifiers I believe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 8ad97b6
@@ -1971,7 +2038,7 @@ public string keyboardLayout | |||
/// True when IME composition is enabled. Requires <see cref="Keyboard.SetIMEEnabled"/> to be called to enable IME, and the user to enable it at the OS level. | |||
/// </summary> | |||
/// <remarks> | |||
/// | |||
/// <see cref="ButtonControl"/> representing a combined left and right alt key. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this remark? I don't quite understand why this is relevant for imeSelected
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 8ad97b6
@@ -1985,6 +2052,7 @@ public string keyboardLayout | |||
/// <param name="key">Key code of key control to return.</param> | |||
/// <exception cref="ArgumentOutOfRangeException">The given <paramref cref="key"/> is not valid.</exception> | |||
/// <remarks> | |||
/// <see cref="KeyControl"/> representing a combined left and right alt key. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 8ad97b6
I don't know how that slipped in -Thanks
@@ -32,9 +32,8 @@ namespace UnityEngine.InputSystem.LowLevel | |||
public unsafe struct KeyboardState : IInputStateTypeInfo | |||
{ | |||
/// <summary> | |||
/// Memory format tag for KeybboardState. | |||
/// Memory format tag for KeybboardState. Returns "KEYS". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 389cce9
[InputControlLayout(stateType = typeof(KeyboardState), isGenericTypeOfDevice = true)] | ||
public class Keyboard : InputDevice, ITextInputReceiver | ||
{ | ||
/// <summary> | ||
/// Total number of key controls on a keyboard, i.e. the number of controls | ||
/// in <see cref="allKeys"/>. | ||
/// </summary> | ||
/// <value>Total number of key controls.</value> | ||
/// <remarks>The integer value represents the total number of key controls.</remarks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove remarks? Its the same info as in summary it seems
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 8ad97b6
@@ -1021,6 +1068,26 @@ public void SetIMEEnabled(bool enabled) | |||
/// | |||
/// See <see cref="Keyboard.SetIMEEnabled"/> for turning IME on/off | |||
/// </remarks> | |||
/// <param name="position"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why new lines in param?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 8ad97b6
/// void Update () | ||
/// { | ||
/// // Set the IME cursor position to the mouse position | ||
/// var x = Input.GetAxis("Mouse X"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this using Input Manager? Wouldn't it make sense to use input system instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ups, old habit - exactly me should know better now after working on the deprecation for so long :D - fixed in 95c3c3e
/// <remarks> | ||
/// <see cref="KeyControl"/> representing the numpad minus key. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs a paragraph after it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 8ad97b6
/// <remarks> | ||
/// <see cref="KeyControl"/> representing the numpad plus key. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a paragraph after it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 8ad97b6
@@ -2009,21 +2077,33 @@ public KeyControl this[Key key] | |||
public static Keyboard current { get; private set; } | |||
|
|||
/// <summary> | |||
/// Make the keyboard the current keyboard (i.e. <see cref="current"/>). | |||
/// Make a keyboard the current active keyboard. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we do inheritDoc on this since defined in base? It should not change meaning in base classes right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's neat to have a example code for this, but I added the inherited doc above for more information: 58eeef6
@@ -2182,11 +2280,23 @@ protected override void RefreshConfiguration() | |||
/// <summary> | |||
/// Called when text input on the keyboard is received. | |||
/// </summary> | |||
/// <param name="character">Character that has been entered.</param> | |||
/// <param name="character">Char value that represents the character that has been entered.</param> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
char value.... ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 8ad97b6
Would recommend fixing issues with CI and comments and then re request review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work and nice examples! 🎉
Approving it already but added some comments/suggestions. Feel free to follow my suggestions or not (some are more nitpicks than others).
Packages/com.unity.inputsystem/InputSystem/Devices/InputDevice.cs
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/InputSystem/Devices/InputDevice.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: João Freire <[email protected]>
Co-authored-by: João Freire <[email protected]>
Co-authored-by: João Freire <[email protected]>
Co-authored-by: João Freire <[email protected]>
Co-authored-by: João Freire <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, congrats to getting through the CI errors on this larger doc PR!
Packages/com.unity.inputsystem/InputSystem/Controls/InputControl.cs
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/InputSystem/Devices/InputDevice.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Ben Pitt <[email protected]>
Co-authored-by: Ben Pitt <[email protected]>
Co-authored-by: Ben Pitt <[email protected]>
Description
Updates the Keyboard documentation.
Testing status & QA
No testing.
Overall Product Risks
Please rate the potential complexity and halo effect from low to high for the reviewers. Note down potential risks to specific Editor branches if any.
Comments to reviewers
Please describe any additional information such as what to focus on, or historical info for the reviewers.
Checklist
Before review:
Changed
,Fixed
,Added
sections.Area_CanDoX
,Area_CanDoX_EvenIfYIsTheCase
,Area_WhenIDoX_AndYHappens_ThisIsTheResult
.During merge:
NEW: ___
.FIX: ___
.DOCS: ___
.CHANGE: ___
.RELEASE: 1.1.0-preview.3
.After merge: