# AspireTerminalKey

- Kind: `struct`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.6.0`
- Namespace: `Aspire.Hosting.ApplicationModel`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/f4c27f2d43ddc1cacd0dd083b30d1fea1cee7a62/src/Aspire.Hosting/ApplicationModel/AspireTerminalKey.cs)
- Implements: `IEquatable<AspireTerminalKey>`

Represents one terminal keypress, optionally combined with modifiers, for [AspireTerminal.SendKeyAsync(AspireTerminalKey, CancellationToken)](/reference/api/csharp/aspire.hosting/aspireterminal/methods.md#sendkeyasync-aspireterminalkey-cancellationtoken).

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public sealed readonly struct AspireTerminalKey
    : System.IEquatable<Aspire.Hosting.ApplicationModel.AspireTerminalKey>
{
    // ...
}
```

## Remarks

Use a named key property and compose [AspireTerminalKey.Ctrl(AspireTerminalKey)](/reference/api/csharp/aspire.hosting/aspireterminalkey/methods.md#ctrl-aspireterminalkey), [AspireTerminalKey.Shift(AspireTerminalKey)](/reference/api/csharp/aspire.hosting/aspireterminalkey/methods.md#shift-aspireterminalkey), and [AspireTerminalKey.Alt(AspireTerminalKey)](/reference/api/csharp/aspire.hosting/aspireterminalkey/methods.md#alt-aspireterminalkey) to add modifiers. Composition is order-independent, and applying the same modifier repeatedly has no additional effect. A default-initialized value is invalid and cannot be sent or passed to a modifier factory.

Letter keys produce lowercase letters without modifiers and uppercase letters with [AspireTerminalKey.Shift(AspireTerminalKey)](/reference/api/csharp/aspire.hosting/aspireterminalkey/methods.md#shift-aspireterminalkey). Digit and punctuation keys follow the US keyboard layout. Use [AspireTerminal.SendTextAsync(string, CancellationToken)](/reference/api/csharp/aspire.hosting/aspireterminal/methods.md#sendtextasync-string-cancellationtoken) for arbitrary text or Unicode rather than composing keypresses.

These values describe terminal input, not physically held keys. Terminal protocols, platforms, and applications differ in how they interpret key combinations. Legacy terminal encoding cannot distinguish Ctrl+I from Tab, Ctrl+M from Enter, or Ctrl+Shift+letter from Ctrl+letter.

## Properties

- [A](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#a) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the A letter key.
- [Apostrophe](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#apostrophe) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the apostrophe ( `'`) key on a US keyboard.
- [B](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#b) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the B letter key.
- [Backslash](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#backslash) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the backslash ( `\`) key on a US keyboard.
- [Backspace](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#backspace) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the Backspace key.
- [Backtick](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#backtick) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the backtick ( ```) key on a US keyboard.
- [C](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#c) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the C letter key.
- [Comma](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#comma) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the comma ( `,`) key on a US keyboard.
- [D](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#d) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the D letter key.
- [D0](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#d0) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the 0 digit key.
- [D1](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#d1) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the 1 digit key.
- [D2](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#d2) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the 2 digit key.
- [D3](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#d3) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the 3 digit key.
- [D4](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#d4) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the 4 digit key.
- [D5](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#d5) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the 5 digit key.
- [D6](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#d6) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the 6 digit key.
- [D7](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#d7) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the 7 digit key.
- [D8](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#d8) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the 8 digit key.
- [D9](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#d9) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the 9 digit key.
- [Delete](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#delete) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the Delete key.
- [Down](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#down) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the Down arrow key.
- [E](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#e) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the E letter key.
- [End](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#end) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the End key.
- [Enter](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#enter) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the Enter key.
- [EqualsSign](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#equalssign) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the equals sign ( `=`) key on a US keyboard.
- [Escape](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#escape) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the Escape key.
- [F](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#f) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the F letter key.
- [F1](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#f1) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the F1 function key.
- [F10](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#f10) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the F10 function key.
- [F11](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#f11) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the F11 function key.
- [F12](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#f12) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the F12 function key.
- [F2](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#f2) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the F2 function key.
- [F3](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#f3) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the F3 function key.
- [F4](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#f4) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the F4 function key.
- [F5](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#f5) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the F5 function key.
- [F6](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#f6) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the F6 function key.
- [F7](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#f7) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the F7 function key.
- [F8](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#f8) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the F8 function key.
- [F9](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#f9) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the F9 function key.
- [G](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#g) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the G letter key.
- [H](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#h) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the H letter key.
- [Home](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#home) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the Home key.
- [I](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#i) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the I letter key.
- [Insert](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#insert) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the Insert key.
- [J](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#j) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the J letter key.
- [K](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#k) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the K letter key.
- [L](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#l) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the L letter key.
- [Left](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#left) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the Left arrow key.
- [LeftBracket](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#leftbracket) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the left bracket ( `[`) key on a US keyboard.
- [M](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#m) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the M letter key.
- [Minus](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#minus) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the minus ( `-`) key on a US keyboard.
- [N](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#n) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the N letter key.
- [O](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#o) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the O letter key.
- [P](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#p) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the P letter key.
- [PageDown](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#pagedown) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the Page Down key.
- [PageUp](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#pageup) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the Page Up key.
- [Period](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#period) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the period ( `.`) key on a US keyboard.
- [Q](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#q) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the Q letter key.
- [R](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#r) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the R letter key.
- [Right](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#right) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the Right arrow key.
- [RightBracket](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#rightbracket) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the right bracket ( `]`) key on a US keyboard.
- [S](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#s) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the S letter key.
- [Semicolon](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#semicolon) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the semicolon ( `;`) key on a US keyboard.
- [Slash](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#slash) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the slash ( `/`) key on a US keyboard.
- [Space](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#space) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the space bar key.
- [T](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#t) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the T letter key.
- [Tab](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#tab) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the Tab key.
- [U](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#u) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the U letter key.
- [Up](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#up) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the Up arrow key.
- [V](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#v) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the V letter key.
- [W](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#w) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the W letter key.
- [X](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#x) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the X letter key.
- [Y](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#y) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the Y letter key.
- [Z](/reference/api/csharp/aspire.hosting/aspireterminalkey/properties.md#z) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` `get` -- Gets the Z letter key.

## Methods

- [Alt(AspireTerminalKey)](/reference/api/csharp/aspire.hosting/aspireterminalkey/methods.md#alt-aspireterminalkey) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` -- Adds the Alt modifier to a terminal keypress.
- [Ctrl(AspireTerminalKey)](/reference/api/csharp/aspire.hosting/aspireterminalkey/methods.md#ctrl-aspireterminalkey) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` -- Adds the Control modifier to a terminal keypress.
- [Equals(AspireTerminalKey)](/reference/api/csharp/aspire.hosting/aspireterminalkey/methods.md#equals-aspireterminalkey) : `bool` -- Determines whether another keypress has the same key identity and modifiers.
- [Equals(object?)](/reference/api/csharp/aspire.hosting/aspireterminalkey/methods.md#equals-object) : `bool` -- Determines whether an object is a keypress with the same key identity and modifiers.
- [GetHashCode](/reference/api/csharp/aspire.hosting/aspireterminalkey/methods.md#gethashcode) : `int` -- Gets a hash code based on the key identity and modifiers.
- [op_Equality(AspireTerminalKey, AspireTerminalKey)](/reference/api/csharp/aspire.hosting/aspireterminalkey/methods.md#op-equality-aspireterminalkey-aspireterminalkey) : `bool` `static` -- Determines whether two keypresses have the same key identity and modifiers.
- [op_Inequality(AspireTerminalKey, AspireTerminalKey)](/reference/api/csharp/aspire.hosting/aspireterminalkey/methods.md#op-inequality-aspireterminalkey-aspireterminalkey) : `bool` `static` -- Determines whether two keypresses differ in key identity or modifiers.
- [Shift(AspireTerminalKey)](/reference/api/csharp/aspire.hosting/aspireterminalkey/methods.md#shift-aspireterminalkey) : [AspireTerminalKey](/reference/api/csharp/aspire.hosting/aspireterminalkey.md) `static` -- Adds the Shift modifier to a terminal keypress.
- [ToString](/reference/api/csharp/aspire.hosting/aspireterminalkey/methods.md#tostring) : `string` -- Gets a readable description of this keypress.

## Examples

```csharp
await terminal.SendKeyAsync(AspireTerminalKey.Shift(AspireTerminalKey.E));
await terminal.SendKeyAsync(AspireTerminalKey.Ctrl(AspireTerminalKey.Alt(AspireTerminalKey.Delete)));
```
