Class KeyboardEvent

Class KeyboardEvent

Namespace: Aspose.Html.Dom.Events
Assembly: Aspose.HTML.dll (25.2.0)

The KeyboardEvent interface provides specific contextual information associated with keyboard devices. Each keyboard event references a key using a value. Keyboard events are commonly directed at the element that has the focus.

[DOMObject]
[ComVisible(true)]
[DOMName("KeyboardEvent")]
public class KeyboardEvent : UIEvent, INotifyPropertyChanged

Inheritance

objectDOMObjectEventUIEventKeyboardEvent

Implements

INotifyPropertyChanged

Inherited Members

UIEvent.View, UIEvent.Detail, Event.NonePhase, Event.CapturingPhase, Event.AtTargetPhase, Event.BubblingPhase, Event.InitEvent(string, bool, bool), Event.PreventDefault(), Event.StopPropagation(), Event.StopImmediatePropagation(), Event.Bubbles, Event.Cancelable, Event.CurrentTarget, Event.EventPhase, Event.Target, Event.TimeStamp, Event.Type, Event.DefaultPrevented, Event.IsTrusted, DOMObject.GetPlatformType(), object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

KeyboardEvent(string)

Initializes a new instance of the Aspose.Html.Dom.Events.KeyboardEvent class.

[DOMConstructor]
public KeyboardEvent(string type)

Parameters

type string

The event type.

KeyboardEvent(string, IDictionary<string, object="">)

Initializes a new instance of the Aspose.Html.Dom.Events.KeyboardEvent class.

[DOMConstructor]
public KeyboardEvent(string type, IDictionary<string, object=""> eventInitDict)

Parameters

type string

The event type.

eventInitDict IDictionary<string, object&gt;

The event initialize dictionary.

Fields

DOM_KEY_LOCATION_LEFT

The key activated originated from the left key location (when there is more than one possible location for this key).

public const ulong DOM_KEY_LOCATION_LEFT = 1

Field Value

ulong

DOM_KEY_LOCATION_NUMPAD

The key activation originated on the numeric keypad or with a virtual key corresponding to the numeric keypad (when there is more than one possible location for this key). Note that the NumLock key should always be encoded with a location of DOM_KEY_LOCATION_STANDARD.

public const ulong DOM_KEY_LOCATION_NUMPAD = 3

Field Value

ulong

DOM_KEY_LOCATION_RIGHT

The key activation originated from the right key location (when there is more than one possible location for this key).

public const ulong DOM_KEY_LOCATION_RIGHT = 2

Field Value

ulong

DOM_KEY_LOCATION_STANDARD

The key activation MUST NOT be distinguished as the left or right version of the key, and (other than the NumLock key) did not originate from the numeric keypad (or did not originate with a virtual key corresponding to the numeric keypad).

public const ulong DOM_KEY_LOCATION_STANDARD = 0

Field Value

ulong

Properties

AltKey

true if the Alt (alternative) (or “Option”) key modifier was active. The un-initialized value of this attribute MUST be false.

[DOMName("altKey")]
public bool AltKey { get; }

Property Value

bool

Code

The code 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.

[DOMName("code")]
public string Code { get; }

Property Value

string

CtrlKey

true if the Control (control) key modifier was active. The un-initialized value of this attribute MUST be false.

[DOMName("ctrlKey")]
public bool CtrlKey { get; }

Property Value

bool

IsComposing

true if the key event occurs as part of a composition session, i.e., after a compositionstart event and before the corresponding compositionend event. The un-initialized value of this attribute MUST be false.

[DOMName("isComposing")]
public bool IsComposing { get; }

Property Value

bool

Key

The key holds the key value of the key pressed. If the value is has a printed representation, it MUST be a non-empty Unicode character string, conforming to the algorithm for determining the key value defined in this specification. If the value is a control key which has no printed representation, it MUST be one of the key values defined in the key values set, as determined by the algorithm for determining the key value. Implementations that are unable to identify a key MUST use the key value Unidentified.

[DOMName("key")]
public string Key { get; }

Property Value

string

Location

The location attribute contains an indication of the logical location of the key on the device.

[DOMName("location")]
public ulong Location { get; }

Property Value

ulong

MetaKey

true if the meta (Meta) key modifier was active.

[DOMName("metaKey")]
public bool MetaKey { get; }

Property Value

bool

Repeat

true if the key has been pressed in a sustained manner. Holding down a key MUST result in the repeating the events keydown, beforeinput, input in this order, at a rate determined by the system configuration. For mobile devices which have long-key-press behavior, the first key event with a repeat attribute value of true MUST serve as an indication of a long-key-press. The length of time that the key MUST be pressed in order to begin repeating is configuration-dependent.

[DOMName("repeat")]
public bool Repeat { get; }

Property Value

bool

ShiftKey

true if the shift (Shift) key modifier was active.

[DOMName("shiftKey")]
public bool ShiftKey { get; }

Property Value

bool </string,></string,>