Skip to content

KgpCommand

Namespace: Hex1b

Assembly: Hex1b.dll

Parsed KGP command from control data key=value pairs.

csharp
public sealed class KgpCommand

Inheritance

ObjectKgpCommand

Properties

Action

The overall action (a key). Default: Transmit.

Returns: KgpAction

csharp
public KgpAction Action { get; init; }

AnimationState

Animation state (s key for a=a). 1=stop, 2=loading, 3=run.

Returns: Int32

csharp
public int AnimationState { get; init; }

CellOffsetX

X-offset within first cell in pixels (X key).

Returns: UInt32

csharp
public uint CellOffsetX { get; init; }

CellOffsetY

Y-offset within first cell in pixels (Y key).

Returns: UInt32

csharp
public uint CellOffsetY { get; init; }

Compression

Compression type (o key). 'z' for zlib, null for none.

Returns: Nullable<Char>

csharp
public char? Compression { get; init; }

CursorMovement

Cursor movement policy (C key). 0=move cursor, 1=don't move.

Returns: Int32

csharp
public int CursorMovement { get; init; }

DeleteTarget

Deletion target (d key). Default: All.

Returns: KgpDeleteTarget

csharp
public KgpDeleteTarget DeleteTarget { get; init; }

DisplayColumns

Number of columns to display over (c key). 0=auto.

Returns: UInt32

csharp
public uint DisplayColumns { get; init; }

DisplayRows

Number of rows to display over (r key). 0=auto.

Returns: UInt32

csharp
public uint DisplayRows { get; init; }

FileOffset

Offset to read from file (O key).

Returns: UInt32

csharp
public uint FileOffset { get; init; }

FileSize

Size of data to read from file (S key).

Returns: UInt32

csharp
public uint FileSize { get; init; }

Format

Pixel data format (f key). Default: Rgba32.

Returns: KgpFormat

csharp
public KgpFormat Format { get; init; }

Height

Image height in pixels (v key).

Returns: UInt32

csharp
public uint Height { get; init; }

ImageId

Image ID (i key). 0 means unspecified.

Returns: UInt32

csharp
public uint ImageId { get; init; }

ImageNumber

Image number (I key). 0 means unspecified.

Returns: UInt32

csharp
public uint ImageNumber { get; init; }

LoopCount

Loop count (v key for a=a). 0=ignored, 1=infinite, n=n-1 loops.

Returns: UInt32

csharp
public uint LoopCount { get; init; }

Medium

Transmission medium (t key). Default: Direct.

Returns: KgpTransmissionMedium

csharp
public KgpTransmissionMedium Medium { get; init; }

MoreData

Whether more chunked data follows (m key). 0=last/only, 1=more.

Returns: Int32

csharp
public int MoreData { get; init; }

ParentImageId

Parent image ID for relative placement (P key).

Returns: UInt32

csharp
public uint ParentImageId { get; init; }

ParentOffsetH

Horizontal offset from parent in cells (H key).

Returns: Int32

csharp
public int ParentOffsetH { get; init; }

ParentOffsetV

Vertical offset from parent in cells (V key).

Returns: Int32

csharp
public int ParentOffsetV { get; init; }

ParentPlacementId

Parent placement ID for relative placement (Q key).

Returns: UInt32

csharp
public uint ParentPlacementId { get; init; }

PlacementId

Placement ID (p key). 0 means unspecified.

Returns: UInt32

csharp
public uint PlacementId { get; init; }

Quiet

Response suppression (q key). 0=normal, 1=suppress OK, 2=suppress all.

Returns: Int32

csharp
public int Quiet { get; init; }

SourceHeight

Height of source rectangle in pixels (h key). 0=entire height.

Returns: UInt32

csharp
public uint SourceHeight { get; init; }

SourceWidth

Width of source rectangle in pixels (w key). 0=entire width.

Returns: UInt32

csharp
public uint SourceWidth { get; init; }

SourceX

Left edge of source rectangle in pixels (x key).

Returns: UInt32

csharp
public uint SourceX { get; init; }

SourceY

Top edge of source rectangle in pixels (y key).

Returns: UInt32

csharp
public uint SourceY { get; init; }

UnicodePlaceholder

Unicode placeholder mode (U key). 1=create virtual placement.

Returns: Int32

csharp
public int UnicodePlaceholder { get; init; }

Width

Image width in pixels (s key).

Returns: UInt32

csharp
public uint Width { get; init; }

ZIndex

Z-index for stacking order (z key).

Returns: Int32

csharp
public int ZIndex { get; init; }

Methods

Parse(string)

Parses a KGP control data string into a .

Parameters:

  • controlData (String): Comma-separated key=value pairs (e.g., "a=T,f=24,s=10,v=20,i=1").

Returns: KgpCommand

A parsed with defaults for unspecified keys.

csharp
public static KgpCommand Parse(string controlData)

Remarks

Protocol specification: https://sw.kovidgoyal.net/kitty/graphics-protocol/

Released under the MIT License.