Table of Contents

Class KeyboardEventDispatchExtensions

Namespace
Bunit
Assembly
Bunit.Web.dll

Keyboard event dispatch helper extension methods.

public static class KeyboardEventDispatchExtensions
Inheritance
KeyboardEventDispatchExtensions
Inherited Members

Methods

KeyDown(IElement, Key, bool, string?)

Raises the @onkeydown event on element, passing the provided key to the event handler.

public static void KeyDown(this IElement element, Key key, bool repeat = false, string? type = null)

Parameters

element IElement

The element to raise the event on.

key Key

The keyboard key to pass to the event handler.

repeat bool

true if a key has been depressed long enough to trigger key repetition, otherwise false.

type string

The type of the event.

KeyDown(IElement, KeyboardEventArgs)

Raises the @onkeydown event on element, passing the provided eventArgs to the event handler.

public static void KeyDown(this IElement element, KeyboardEventArgs eventArgs)

Parameters

element IElement

The element to raise the event on.

eventArgs KeyboardEventArgs

The event arguments to pass to the event handler.

KeyDown(IElement, string, string?, float, bool, bool, bool, bool, bool, string?)

Raises the @onkeydown event on element, passing the provided properties to the event handler via a KeyboardEventArgs object.

public static void KeyDown(this IElement element, string key, string? code = null, float location = 0, bool repeat = false, bool ctrlKey = false, bool shiftKey = false, bool altKey = false, bool metaKey = false, string? type = null)

Parameters

element IElement

The element to raise the event on.

key string

The key value of the key represented by the event. If the value has a printed representation, this attribute's value is the same as the char attribute. Otherwise, it's one of the key value strings specified in 'Key values'. If the key can't be identified, this is the string "Unidentified".

code string

Holds a string that identifies the physical key being pressed. The value is not affected by the current keyboard layout or modifier state, so a particular key will always return the same value.

location float

The location of the key on the device.

repeat bool

true if a key has been depressed long enough to trigger key repetition, otherwise false.

ctrlKey bool

true if the control key was down when the event was fired. false otherwise.

shiftKey bool

true if the shift key was down when the event was fired. false otherwise.

altKey bool

true if the alt key was down when the event was fired. false otherwise.

metaKey bool

true if the meta key was down when the event was fired. false otherwise.

type string

The type of the event.

KeyDownAsync(IElement, KeyboardEventArgs)

Raises the @onkeydown event on element, passing the provided eventArgs to the event handler.

public static Task KeyDownAsync(this IElement element, KeyboardEventArgs eventArgs)

Parameters

element IElement

The element to raise the event on.

eventArgs KeyboardEventArgs

The event arguments to pass to the event handler.

Returns

Task

A task that completes when the event handler is done.

KeyPress(IElement, Key, bool, string?)

Raises the @onkeypress event on element, passing the provided key to the event handler.

public static void KeyPress(this IElement element, Key key, bool repeat = false, string? type = null)

Parameters

element IElement

The element to raise the event on.

key Key

The keyboard key to pass to the event handler.

repeat bool

true if a key has been depressed long enough to trigger key repetition, otherwise false.

type string

The type of the event.

KeyPress(IElement, KeyboardEventArgs)

Raises the @onkeypress event on element, passing the provided eventArgs to the event handler.

public static void KeyPress(this IElement element, KeyboardEventArgs eventArgs)

Parameters

element IElement

The element to raise the event on.

eventArgs KeyboardEventArgs

The event arguments to pass to the event handler.

KeyPress(IElement, string, string?, float, bool, bool, bool, bool, bool, string?)

Raises the @onkeypress event on element, passing the provided properties to the event handler via a KeyboardEventArgs object.

public static void KeyPress(this IElement element, string key, string? code = null, float location = 0, bool repeat = false, bool ctrlKey = false, bool shiftKey = false, bool altKey = false, bool metaKey = false, string? type = null)

Parameters

element IElement

The element to raise the event on.

key string

The key value of the key represented by the event. If the value has a printed representation, this attribute's value is the same as the char attribute. Otherwise, it's one of the key value strings specified in 'Key values'. If the key can't be identified, this is the string "Unidentified".

code string

Holds a string that identifies the physical key being pressed. The value is not affected by the current keyboard layout or modifier state, so a particular key will always return the same value.

location float

The location of the key on the device.

repeat bool

true if a key has been depressed long enough to trigger key repetition, otherwise false.

ctrlKey bool

true if the control key was down when the event was fired. false otherwise.

shiftKey bool

true if the shift key was down when the event was fired. false otherwise.

altKey bool

true if the alt key was down when the event was fired. false otherwise.

metaKey bool

true if the meta key was down when the event was fired. false otherwise.

type string

The type of the event.

KeyPressAsync(IElement, KeyboardEventArgs)

Raises the @onkeypress event on element, passing the provided eventArgs to the event handler.

public static Task KeyPressAsync(this IElement element, KeyboardEventArgs eventArgs)

Parameters

element IElement

The element to raise the event on.

eventArgs KeyboardEventArgs

The event arguments to pass to the event handler.

Returns

Task

A task that completes when the event handler is done.

KeyUp(IElement, Key, bool, string?)

Raises the @onkeyup event on element, passing the provided key to the event handler.

public static void KeyUp(this IElement element, Key key, bool repeat = false, string? type = null)

Parameters

element IElement

The element to raise the event on.

key Key

The keyboard key to pass to the event handler.

repeat bool

true if a key has been depressed long enough to trigger key repetition, otherwise false.

type string

The type of the event.

KeyUp(IElement, KeyboardEventArgs)

Raises the @onkeyup event on element, passing the provided eventArgs to the event handler.

public static void KeyUp(this IElement element, KeyboardEventArgs eventArgs)

Parameters

element IElement

The element to raise the event on.

eventArgs KeyboardEventArgs

The event arguments to pass to the event handler.

KeyUp(IElement, string, string?, float, bool, bool, bool, bool, bool, string?)

Raises the @onkeyup event on element, passing the provided properties to the event handler via a KeyboardEventArgs object.

public static void KeyUp(this IElement element, string key, string? code = null, float location = 0, bool repeat = false, bool ctrlKey = false, bool shiftKey = false, bool altKey = false, bool metaKey = false, string? type = null)

Parameters

element IElement

The element to raise the event on.

key string

The key value of the key represented by the event. If the value has a printed representation, this attribute's value is the same as the char attribute. Otherwise, it's one of the key value strings specified in 'Key values'. If the key can't be identified, this is the string "Unidentified".

code string

Holds a string that identifies the physical key being pressed. The value is not affected by the current keyboard layout or modifier state, so a particular key will always return the same value.

location float

The location of the key on the device.

repeat bool

true if a key has been depressed long enough to trigger key repetition, otherwise false.

ctrlKey bool

true if the control key was down when the event was fired. false otherwise.

shiftKey bool

true if the shift key was down when the event was fired. false otherwise.

altKey bool

true if the alt key was down when the event was fired. false otherwise.

metaKey bool

true if the meta key was down when the event was fired. false otherwise.

type string

The type of the event.

KeyUpAsync(IElement, KeyboardEventArgs)

Raises the @onkeyup event on element, passing the provided eventArgs to the event handler.

public static Task KeyUpAsync(this IElement element, KeyboardEventArgs eventArgs)

Parameters

element IElement

The element to raise the event on.

eventArgs KeyboardEventArgs

The event arguments to pass to the event handler.

Returns

Task

A task that completes when the event handler is done.

Progress Telerik

Premium sponsor: Progress Telerik.

Packt

Editorial support provided by Packt.

.NET Foundation

Supported by the .NET Foundation.