Table of Contents

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 IKeyInterceptorObserver

The observer that will receive key events.

options KeyInterceptorOptions

The 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 string

The unique identifier of the HTML element.

options KeyInterceptorOptions

The options for key interception.

keyDown IKeyDownObserver

The observer for key down events.

keyUp IKeyUpObserver

The 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 string

The unique identifier of the HTML element.

options KeyInterceptorOptions

The 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 string

The unique identifier of the HTML element.

options KeyInterceptorOptions

The 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 IKeyInterceptorObserver

The 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 string

The 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 IKeyInterceptorObserver

The observer.

option KeyOptions

The 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 string

The unique identifier of the HTML element.

option KeyOptions

The key options to update.

Returns

Task

A task that represents the asynchronous operation.