Interface IKeyInterceptorService
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
Represents a service that intercepts key events for specified HTML elements.
public interface IKeyInterceptorService : IAsyncDisposable
- Inherited Members
- Extension Methods
Methods
SubscribeAsync(IKeyInterceptorObserver, KeyInterceptorOptions)
Subscribes an observer to key events for a specified element with the provided options.
Task SubscribeAsync(IKeyInterceptorObserver observer, KeyInterceptorOptions options)
Parameters
observer
IKeyInterceptorObserverThe observer that will receive key events.
options
KeyInterceptorOptionsThe options for key interception.
Returns
- Task
A task that represents the asynchronous operation.
Remarks
If you re-subscribe with the same observer and different KeyInterceptorOptions settings, the new KeyInterceptorOptions will not have any effect.
SubscribeAsync(string, KeyInterceptorOptions, IKeyDownObserver?, IKeyUpObserver?)
Subscribes to key events for a specified element with the provided options.
Task SubscribeAsync(string elementId, KeyInterceptorOptions options, IKeyDownObserver? keyDown = null, IKeyUpObserver? keyUp = null)
Parameters
elementId
stringThe unique identifier of the HTML element.
options
KeyInterceptorOptionsThe options for key interception.
keyDown
IKeyDownObserverThe observer for key down events.
keyUp
IKeyUpObserverThe observer for key up events.
Returns
- Task
A task that represents the asynchronous operation.
Remarks
If you re-subscribe with the same elementId and different KeyInterceptorOptions settings, the new KeyInterceptorOptions will not have any effect.
SubscribeAsync(string, KeyInterceptorOptions, Action<KeyboardEventArgs>?, Action<KeyboardEventArgs>?)
Subscribes to key events for a specified element with the provided options.
Task SubscribeAsync(string elementId, KeyInterceptorOptions options, Action<KeyboardEventArgs>? keyDown = null, Action<KeyboardEventArgs>? keyUp = null)
Parameters
elementId
stringThe unique identifier of the HTML element.
options
KeyInterceptorOptionsThe options for key interception.
keyDown
Action<KeyboardEventArgs>The lambda action to invoke on key down events.
keyUp
Action<KeyboardEventArgs>The lambda action to invoke on key up events.
Returns
- Task
A task that represents the asynchronous operation.
Remarks
If you re-subscribe with the same elementId and different KeyInterceptorOptions settings, the new KeyInterceptorOptions will not have any effect.
SubscribeAsync(string, KeyInterceptorOptions, Func<KeyboardEventArgs, Task>?, Func<KeyboardEventArgs, Task>?)
Subscribes to key events for a specified element with the provided options.
Task SubscribeAsync(string elementId, KeyInterceptorOptions options, Func<KeyboardEventArgs, Task>? keyDown = null, Func<KeyboardEventArgs, Task>? keyUp = null)
Parameters
elementId
stringThe unique identifier of the HTML element.
options
KeyInterceptorOptionsThe options for key interception.
keyDown
Func<KeyboardEventArgs, Task>The asynchronous lambda function to invoke on key down events.
keyUp
Func<KeyboardEventArgs, Task>The asynchronous lambda function to invoke on key up events.
Returns
- Task
A task that represents the asynchronous operation.
Remarks
If you re-subscribe with the same elementId and different KeyInterceptorOptions settings, the new KeyInterceptorOptions will not have any effect.
UnsubscribeAsync(IKeyInterceptorObserver)
Unsubscribes an observer from key events.
Task UnsubscribeAsync(IKeyInterceptorObserver observer)
Parameters
observer
IKeyInterceptorObserverThe observer to unsubscribe.
Returns
- Task
A task that represents the asynchronous operation.
UnsubscribeAsync(string)
Unsubscribes from key events for a specified element.
Task UnsubscribeAsync(string elementId)
Parameters
elementId
stringThe unique identifier of the HTML element.
Returns
- Task
A task that represents the asynchronous operation.
UpdateKeyAsync(IKeyInterceptorObserver, KeyOptions)
Updates the key options for a specified element.
Task UpdateKeyAsync(IKeyInterceptorObserver observer, KeyOptions option)
Parameters
observer
IKeyInterceptorObserverThe observer.
option
KeyOptionsThe key options to update.
Returns
- Task
A task that represents the asynchronous operation.
UpdateKeyAsync(string, KeyOptions)
Updates the key options for a specified element.
Task UpdateKeyAsync(string elementId, KeyOptions option)
Parameters
elementId
stringThe unique identifier of the HTML element.
option
KeyOptionsThe key options to update.
Returns
- Task
A task that represents the asynchronous operation.