Skip to content
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

Merged
merged 25 commits into from
Dec 9, 2024

Conversation

ritamerkl
Copy link
Collaborator

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.

  • Complexity:
  • Halo Effect:

Comments to reviewers

Please describe any additional information such as what to focus on, or historical info for the reviewers.

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

After merge:

  • Create forward/backward port if needed. If you are blocked from creating a forward port now please add a task to ISX-1444.

@ritamerkl ritamerkl added the DocsQualityWeek2024 Temporary label for docs week label Dec 3, 2024
@ritamerkl ritamerkl requested a review from ekcoh December 3, 2024 18:08
@ritamerkl ritamerkl changed the title DOSC: Update Keyboard documentation DOCS: Update Keyboard documentation Dec 3, 2024
Copy link
Collaborator

@jfreire-unity jfreire-unity left a 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.
Copy link
Collaborator

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..."

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree

Copy link
Collaborator

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

Copy link
Collaborator Author

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.
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above comment

Copy link
Collaborator Author

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".
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo?

Copy link
Collaborator Author

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>
Copy link
Collaborator

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

Copy link
Collaborator Author

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">
Copy link
Collaborator

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?

Copy link
Collaborator Author

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");
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.
Copy link
Collaborator

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?

Copy link
Collaborator Author

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>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

char value.... ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 8ad97b6

@ekcoh
Copy link
Collaborator

ekcoh commented Dec 4, 2024

Would recommend fixing issues with CI and comments and then re request review

@ritamerkl ritamerkl requested a review from ekcoh December 6, 2024 10:27
@jfreire-unity jfreire-unity requested a review from duckets December 6, 2024 11:07
Copy link
Collaborator

@jfreire-unity jfreire-unity left a 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).

ritamerkl and others added 5 commits December 6, 2024 15:04
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]>
Copy link
Collaborator

@ekcoh ekcoh left a 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!

@ritamerkl ritamerkl merged commit 790d9cc into develop Dec 9, 2024
77 checks passed
@ritamerkl ritamerkl deleted the docs-update-keyboard-documentation branch December 9, 2024 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DocsQualityWeek2024 Temporary label for docs week
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants