Skip to content

Commit cec229f

Browse files
committed
Correct headless methods documentation
1 parent 7b4bfcf commit cec229f

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/Headless/Avalonia.Headless/HeadlessWindowExtensions.cs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static class HeadlessWindowExtensions
4141
}
4242

4343
/// <summary>
44-
/// Simulates keyboard press on the headless window/toplevel.
44+
/// Simulates a keyboard press on the headless window/toplevel.
4545
/// </summary>
4646
[Obsolete("Use the overload that takes a physical key and key symbol instead, or KeyPressQwerty alternatively.")]
4747
public static void KeyPress(this TopLevel topLevel, Key key, RawInputModifiers modifiers) =>
@@ -61,7 +61,7 @@ public static void KeyPressQwerty(this TopLevel topLevel, PhysicalKey physicalKe
6161
RunJobsOnImpl(topLevel, w => w.KeyPress(physicalKey.ToQwertyKey(), modifiers, physicalKey, physicalKey.ToQwertyKeySymbol()));
6262

6363
/// <summary>
64-
/// Simulates keyboard release on the headless window/toplevel.
64+
/// Simulates a keyboard release on the headless window/toplevel.
6565
/// </summary>
6666
[Obsolete("Use the overload that takes a physical key and key symbol instead, or KeyReleaseQwerty alternatively.")]
6767
public static void KeyRelease(this TopLevel topLevel, Key key, RawInputModifiers modifiers) =>
@@ -81,41 +81,47 @@ public static void KeyReleaseQwerty(this TopLevel topLevel, PhysicalKey physical
8181
RunJobsOnImpl(topLevel, w => w.KeyRelease(physicalKey.ToQwertyKey(), modifiers, physicalKey, physicalKey.ToQwertyKeySymbol()));
8282

8383
/// <summary>
84-
/// Simulates a text input event on the headless window/toplevel
84+
/// Simulates a text input event on the headless window/toplevel.
8585
/// </summary>
86+
/// <remarks>
87+
/// This event is independent of KeyPress and KeyRelease. If you need to simulate text input to a TextBox or a similar control, please use KeyTextInput.
88+
/// </remarks>
8689
public static void KeyTextInput(this TopLevel topLevel, string text) =>
8790
RunJobsOnImpl(topLevel, w => w.TextInput(text));
8891

8992
/// <summary>
90-
/// Simulates mouse down on the headless window/toplevel.
93+
/// Simulates a mouse down on the headless window/toplevel.
9194
/// </summary>
95+
/// <remarks>
96+
/// In the headless platform, there is a single mouse pointer. There are no helper methods for touch or pen input.
97+
/// </remarks>
9298
public static void MouseDown(this TopLevel topLevel, Point point, MouseButton button,
9399
RawInputModifiers modifiers = RawInputModifiers.None) =>
94100
RunJobsOnImpl(topLevel, w => w.MouseDown(point, button, modifiers));
95101

96102
/// <summary>
97-
/// Simulates mouse move on the headless window/toplevel.
103+
/// Simulates a mouse move on the headless window/toplevel.
98104
/// </summary>
99105
public static void MouseMove(this TopLevel topLevel, Point point,
100106
RawInputModifiers modifiers = RawInputModifiers.None) =>
101107
RunJobsOnImpl(topLevel, w => w.MouseMove(point, modifiers));
102108

103109
/// <summary>
104-
/// Simulates mouse up on the headless window/toplevel.
110+
/// Simulates a mouse up on the headless window/toplevel.
105111
/// </summary>
106112
public static void MouseUp(this TopLevel topLevel, Point point, MouseButton button,
107113
RawInputModifiers modifiers = RawInputModifiers.None) =>
108114
RunJobsOnImpl(topLevel, w => w.MouseUp(point, button, modifiers));
109115

110116
/// <summary>
111-
/// Simulates mouse wheel on the headless window/toplevel.
117+
/// Simulates a mouse wheel on the headless window/toplevel.
112118
/// </summary>
113119
public static void MouseWheel(this TopLevel topLevel, Point point, Vector delta,
114120
RawInputModifiers modifiers = RawInputModifiers.None) =>
115121
RunJobsOnImpl(topLevel, w => w.MouseWheel(point, delta, modifiers));
116122

117123
/// <summary>
118-
/// Simulates drag'n'drop target on the headless window/toplevel.
124+
/// Simulates a drag and drop target event on the headless window/toplevel. This event simulates a user moving files from another app to the current app.
119125
/// </summary>
120126
public static void DragDrop(this TopLevel topLevel, Point point, RawDragEventType type, IDataObject data,
121127
DragDropEffects effects, RawInputModifiers modifiers = RawInputModifiers.None) =>

0 commit comments

Comments
 (0)