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
observerIKeyInterceptorObserverThe observer that will receive key events.
optionsKeyInterceptorOptionsThe 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
elementIdstringThe unique identifier of the HTML element.
optionsKeyInterceptorOptionsThe options for key interception.
keyDownIKeyDownObserverThe observer for key down events.
keyUpIKeyUpObserverThe 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
elementIdstringThe unique identifier of the HTML element.
optionsKeyInterceptorOptionsThe options for key interception.
keyDownAction<KeyboardEventArgs>The lambda action to invoke on key down events.
keyUpAction<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
elementIdstringThe unique identifier of the HTML element.
optionsKeyInterceptorOptionsThe options for key interception.
keyDownFunc<KeyboardEventArgs, Task>The asynchronous lambda function to invoke on key down events.
keyUpFunc<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
observerIKeyInterceptorObserverThe 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
elementIdstringThe 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
observerIKeyInterceptorObserverThe observer.
optionKeyOptionsThe 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
elementIdstringThe unique identifier of the HTML element.
optionKeyOptionsThe key options to update.
Returns
- Task
A task that represents the asynchronous operation.