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
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a0ad998
update keyboard documentation
ritamerkl Dec 3, 2024
0bddacb
fix xml format for MakeCurrent() example
ritamerkl Dec 5, 2024
04a3e1b
fix code examples in InputControl and InputDevice
ritamerkl Dec 5, 2024
6703c57
added example for OnAdded too, uniformed the remarks section
ritamerkl Dec 5, 2024
4cfc8a6
fixed doc examples in Keyboard.cs
ritamerkl Dec 5, 2024
95c3c3e
remove input manager references from Keyboard.cs
ritamerkl Dec 5, 2024
603a947
fix para section in code example
ritamerkl Dec 5, 2024
389cce9
fixes on typo and <see.. /> usage
ritamerkl Dec 5, 2024
58eeef6
inherit documentation for MakeCurrent
ritamerkl Dec 5, 2024
8ad97b6
formatting small text adjustments
ritamerkl Dec 5, 2024
ec93f25
added type reference for char
ritamerkl Dec 5, 2024
e4cfd6a
use <see> instead of <seealso>
ritamerkl Dec 5, 2024
229b655
doc fixes
ritamerkl Dec 5, 2024
99ca583
remove code out of remarks section
ritamerkl Dec 5, 2024
e2d5fd2
fixes for docs
ritamerkl Dec 5, 2024
0edc347
fix CI failures
ritamerkl Dec 6, 2024
fc574d2
Merge branch 'develop' into docs-update-keyboard-documentation
ritamerkl Dec 6, 2024
51c9865
small text fix
ritamerkl Dec 6, 2024
69612a3
phrasing fix
ritamerkl Dec 6, 2024
f6755a4
Small phrasing fix
ritamerkl Dec 6, 2024
e107217
small addition on text for tab key
ritamerkl Dec 6, 2024
9ea96b9
Formatting of text
ritamerkl Dec 6, 2024
62ca3ba
Input Control update text
ritamerkl Dec 8, 2024
a2619bc
Input Device update text
ritamerkl Dec 8, 2024
6342ca8
Update text for IME composition event
ritamerkl Dec 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,60 @@ protected void RefreshConfigurationIfNeeded()
}
}

/// <summary>
/// Refresh the configuration of the control. This is used to update the control's state (e.g. Keyboard Layout or display Name of Keys).
/// </summary>
/// <remarks>
/// The system will call this method automatically whenever change is made to one of the control's configuration properties.
ritamerkl marked this conversation as resolved.
Show resolved Hide resolved
/// See <seealso cref="RefreshConfigurationIfNeeded"/>.
/// </remarks>
/// <example>
/// <code>
/// public class MyDevice : InputDevice
jfreire-unity marked this conversation as resolved.
Show resolved Hide resolved
/// {
/// public enum Orientation
/// {
/// Horizontal,
/// Vertical,
/// }
/// private Orientation m_Orientation;
///
/// public Orientation orientation
/// {
/// get
/// {
/// // Call RefreshOrientation if the configuration of the device has been
/// // invalidated since last time we initialized m_Orientation.
/// // Calling RefreshConfigurationIfNeeded() is sufficient in most cases, RefreshConfiguration() forces the refresh.
/// RefreshConfiguration();
/// return m_Orientation;
/// }
/// }
/// protected override void RefreshConfiguration()
/// {
/// // Fetch the current orientation from the backend. How you do this
/// // depends on your device. Using DeviceCommands is one way.
/// var fetchOrientationCommand = new FetchOrientationCommand();
/// ExecuteCommand(ref fetchOrientationCommand);
/// m_Orientation = fetchOrientation;
///
/// // Reflect the orientation on the device.
/// switch (m_Orientation)
/// {
/// case Orientation.Vertical:
/// InputSystem.RemoveDeviceUsage(this, s_Horizontal);
/// InputSystem.AddDeviceUsage(this, s_Vertical);
/// break;
///
/// case Orientation.Horizontal:
/// InputSystem.RemoveDeviceUsage(this, s_Vertical);
/// InputSystem.AddDeviceUsage(this, s_Horizontal);
/// break;
/// }
/// }
/// }
/// </code>
/// </example>
protected virtual void RefreshConfiguration()
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public int scanCode
return m_ScanCode;
}
}

/// <inheritdoc/>
protected override void RefreshConfiguration()
{
// Wipe our last cached set of data (if any).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,24 @@ protected virtual void OnAdded()
/// </summary>
/// <remarks>
/// This is called <em>after</em> the device has already been removed.
/// </remarks>
/// <seealso cref="InputSystem.devices"/>
/// <seealso cref="InputDeviceChange.Removed"/>
/// <seealso cref="OnRemoved"/>
/// </remarks>
/// <example>
/// <code>
/// public class MyDevice : InputDevice
/// {
/// protected override void OnRemoved()
/// {
/// // use this context to unassign the current device for instance
/// base.OnRemoved();
/// if (current == this)
/// current = null;
/// }
/// }
/// </code>
/// </example>
protected virtual void OnRemoved()
ritamerkl marked this conversation as resolved.
Show resolved Hide resolved
{
}
Expand Down
Loading
Loading