Table of Contents

Struct KeyboardEventData

Namespace
SharpHook.Data
Assembly
SharpHook.dll

Represents the data of a keyboard-related event.

[ExcludeFromCodeCoverage]
public struct KeyboardEventData : IEquatable<KeyboardEventData>
Implements
Inherited Members

Fields

KeyCode

The key code.

public KeyCode KeyCode

Field Value

KeyCode

The key code.

RawCode

The OS-specific key code.

public ushort RawCode

Field Value

ushort

The OS-specific key code.

RawKeyChar

The character of the key.

public ushort RawKeyChar

Field Value

ushort

The character of the key.

Remarks

This field is available only for the KeyTyped event.

In general KeyChar should be used instead of this field. This field is of type ushort purely for marshalling reasons. It should be used as a char.

RawUndefinedChar

The value of RawKeyChar in events of type KeyPressed and KeyReleased.

public static readonly ushort RawUndefinedChar

Field Value

ushort

UndefinedChar

The value of KeyChar in events of type KeyPressed and KeyReleased.

public static readonly char UndefinedChar

Field Value

char

Properties

KeyChar

The character of the key.

public readonly char KeyChar { get; }

Property Value

char

The character of the key.

Remarks

This property is available only for the KeyTyped event.

Methods

Equals(KeyboardEventData)

Compares this object to another object for equality.

public readonly bool Equals(KeyboardEventData data)

Parameters

data KeyboardEventData

The object to compare

Returns

bool

true if the objects are equal. Otherwise, false.

Equals(object?)

Compares this object to another object for equality.

public override readonly bool Equals(object? obj)

Parameters

obj object

The object to compare

Returns

bool

true if the objects are equal. Otherwise, false.

GetHashCode()

Gets the hash code of this object.

public override readonly int GetHashCode()

Returns

int

The hash code of this object.

ToString()

Returns the string representation of this object.

public override readonly string ToString()

Returns

string

The string representation of this object.

Operators

operator ==(KeyboardEventData, KeyboardEventData)

Compares two objects for equality.

public static bool operator ==(KeyboardEventData left, KeyboardEventData right)

Parameters

left KeyboardEventData

The first object to compare

right KeyboardEventData

The second object to compare

Returns

bool

true if the objects are equal. Otherwise, false.

operator !=(KeyboardEventData, KeyboardEventData)

Compares two objects for inequality.

public static bool operator !=(KeyboardEventData left, KeyboardEventData right)

Parameters

left KeyboardEventData

The first object to compare

right KeyboardEventData

The second object to compare

Returns

bool

true if the objects are not equal. Otherwise, false.

See Also