Browse Source
Merge pull request #11574 from AvaloniaUI/hide-input-devies
Remove IKeyboardDevice/IPointerDevice/IDragDropDevice from public API, as they are not really used anywhere
pull/11585/head
Max Katz
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with
9 additions and
14 deletions
-
src/Avalonia.Base/Input/IKeyboardDevice.cs
-
src/Avalonia.Base/Input/IMouseDevice.cs
-
src/Avalonia.Base/Input/IPenDevice.cs
-
src/Avalonia.Base/Input/IPointerDevice.cs
-
src/Avalonia.Base/Input/KeyEventArgs.cs
-
src/Avalonia.Base/Input/KeyboardDevice.cs
-
src/Avalonia.Base/Input/Raw/IDragDropDevice.cs
-
src/Avalonia.Base/Input/TextInputEventArgs.cs
-
tests/Avalonia.Controls.UnitTests/Primitives/SelectingItemsControlTests.cs
|
|
|
@ -43,7 +43,7 @@ namespace Avalonia.Input |
|
|
|
PenBarrelButton = 2048 |
|
|
|
} |
|
|
|
|
|
|
|
[NotClientImplementable] |
|
|
|
[PrivateApi] |
|
|
|
public interface IKeyboardDevice : IInputDevice |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
@ -5,7 +5,7 @@ namespace Avalonia.Input |
|
|
|
/// <summary>
|
|
|
|
/// Represents a mouse device.
|
|
|
|
/// </summary>
|
|
|
|
[NotClientImplementable] |
|
|
|
[PrivateApi] |
|
|
|
public interface IMouseDevice : IPointerDevice |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,8 +1,11 @@ |
|
|
|
namespace Avalonia.Input |
|
|
|
using Avalonia.Metadata; |
|
|
|
|
|
|
|
namespace Avalonia.Input |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Represents a pen/stylus device.
|
|
|
|
/// </summary>
|
|
|
|
[PrivateApi] |
|
|
|
public interface IPenDevice : IPointerDevice |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
@ -3,7 +3,7 @@ using Avalonia.Metadata; |
|
|
|
|
|
|
|
namespace Avalonia.Input |
|
|
|
{ |
|
|
|
[NotClientImplementable] |
|
|
|
[PrivateApi] |
|
|
|
public interface IPointerDevice : IInputDevice |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
@ -5,8 +5,6 @@ namespace Avalonia.Input |
|
|
|
{ |
|
|
|
public class KeyEventArgs : RoutedEventArgs |
|
|
|
{ |
|
|
|
public IKeyboardDevice? Device { get; init; } |
|
|
|
|
|
|
|
public Key Key { get; init; } |
|
|
|
|
|
|
|
public KeyModifiers KeyModifiers { get; init; } |
|
|
|
|
|
|
|
@ -192,7 +192,6 @@ namespace Avalonia.Input |
|
|
|
KeyEventArgs ev = new KeyEventArgs |
|
|
|
{ |
|
|
|
RoutedEvent = routedEvent, |
|
|
|
Device = this, |
|
|
|
Key = keyInput.Key, |
|
|
|
KeyModifiers = keyInput.Modifiers.ToKeyModifiers(), |
|
|
|
Source = element, |
|
|
|
@ -241,7 +240,6 @@ namespace Avalonia.Input |
|
|
|
{ |
|
|
|
var ev = new TextInputEventArgs() |
|
|
|
{ |
|
|
|
Device = this, |
|
|
|
Text = text.Text, |
|
|
|
Source = element, |
|
|
|
RoutedEvent = InputElement.TextInputEvent |
|
|
|
|
|
|
|
@ -2,7 +2,7 @@ |
|
|
|
|
|
|
|
namespace Avalonia.Input.Raw |
|
|
|
{ |
|
|
|
[NotClientImplementable] |
|
|
|
[PrivateApi] |
|
|
|
public interface IDragDropDevice : IInputDevice |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
@ -4,8 +4,6 @@ namespace Avalonia.Input |
|
|
|
{ |
|
|
|
public class TextInputEventArgs : RoutedEventArgs |
|
|
|
{ |
|
|
|
public IKeyboardDevice? Device { get; set; } |
|
|
|
|
|
|
|
public string? Text { get; set; } |
|
|
|
public string? Text { get; init; } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -2141,7 +2141,6 @@ namespace Avalonia.Controls.UnitTests.Primitives |
|
|
|
target.RaiseEvent(new TextInputEventArgs |
|
|
|
{ |
|
|
|
RoutedEvent = InputElement.TextInputEvent, |
|
|
|
Device = KeyboardDevice.Instance, |
|
|
|
Text = "Foo" |
|
|
|
}); |
|
|
|
|
|
|
|
@ -2152,7 +2151,6 @@ namespace Avalonia.Controls.UnitTests.Primitives |
|
|
|
target.RaiseEvent(new TextInputEventArgs |
|
|
|
{ |
|
|
|
RoutedEvent = InputElement.TextInputEvent, |
|
|
|
Device = KeyboardDevice.Instance, |
|
|
|
Text = "Foo" |
|
|
|
}); |
|
|
|
|
|
|
|
|