Class
BaseKeyViewModel

Represents the base class for virtual keyboard key view models.

Definition

Constructors

BaseKeyViewModel(int, KeyType, double, double)

Initializes a new instance of the BaseKeyViewModel class.

Declaration

cs-api-definition
protected BaseKeyViewModel(int virtualKey, KeyType keyType, double keyWidth, double keyHeight)

Parameters

virtualKey

int

The virtual key.

keyType

KeyType

The type of the key.

keyWidth

double

The width of the key.

keyHeight

double

The height of the key.

Properties

DisplayText

Gets or sets the text to be displayed for the key.

Declaration

cs-api-definition
public string DisplayText { get; set; }

Property Value

string

KeyCommand

Gets or sets the command to be executed hen the key is pressed.

Declaration

cs-api-definition
public ICommand KeyCommand { get; set; }

Property Value

ICommand

KeyHeight

Gets the height of the key.

Declaration

cs-api-definition
public double KeyHeight { get; }

Property Value

double

KeySoundPlayer

Gets the sound player that will be called to produce a sound when this key is pressed.

Declaration

cs-api-definition
public IKeySoundPlayer KeySoundPlayer { get; }

Property Value

IKeySoundPlayer

KeyType

Gets the type of the key.

Declaration

cs-api-definition
public KeyType KeyType { get; }

Property Value

KeyType

KeyWidth

Gets the width of the key.

Declaration

cs-api-definition
public double KeyWidth { get; }

Property Value

double

ModifierKeys

Gets the state of the modifier keys from the last update.

Declaration

cs-api-definition
public ModifierKeys ModifierKeys { get; }

Property Value

ModifierKeys

VirtualKey

Gets the virtual key of the key.

Declaration

cs-api-definition
public int VirtualKey { get; }

Property Value

int

Methods

GetModifiers()

Gets the state of the modifier keys (Shift, Ctrl...).

Declaration

cs-api-definition
protected ReadOnlyCollection<int> GetModifiers()

Returns

ReadOnlyCollection<int>

OnKeyCommandExecuted(object)

The method called by the default command assigned to the key.

Declaration

cs-api-definition
protected abstract void OnKeyCommandExecuted(object commandParameter)

Parameters

commandParameter

object

Update(IKeyUpdateContext)

Called when the state of the keyboard changes.

Declaration

cs-api-definition
public virtual void Update(IKeyUpdateContext context)

Parameters

context

IKeyUpdateContext