K3Key

data class K3Key(val id: K3KeyId, val flickId: K3FlickId? = null, val gap: Boolean = false, val output: K3StringOrDescriptor? = null, val longPressKeyIds: List<K3KeyId>? = null, val longPressDefaultKeyId: K3KeyId? = null, val multiTapKeyIds: List<K3KeyId>? = null, val stretch: Boolean = false, val layerId: K3LayerId? = null, val width: Double = DEFAULT_WIDTH, val origin: SourceFileRef) : K3ModelComponent(source)

A key is a reusable component that maps a key id to its output, and any long press, multi-tap or flick keys.

See UTS #35 Part 7 | Element: key

Constructors

Link copied to clipboard
constructor(id: K3KeyId, flickId: K3FlickId? = null, gap: Boolean = false, output: K3StringOrDescriptor? = null, longPressKeyIds: List<K3KeyId>? = null, longPressDefaultKeyId: K3KeyId? = null, multiTapKeyIds: List<K3KeyId>? = null, stretch: Boolean = false, layerId: K3LayerId? = null, width: Double = DEFAULT_WIDTH, origin: SourceFileRef)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The referenced flick by id, if any. Ignored for hardware layouts.

Link copied to clipboard

True if this key has no output, and should be rendered as a gap. The width and stretch attributes still apply.

Link copied to clipboard
val id: K3KeyId

The unique key id.

Link copied to clipboard

If non-null, this key is a layer switch key. Upon key press, the current layer is switched to the referenced layer within this model. Ignored for hardware layouts, as these use modifiers to switch layers.

Link copied to clipboard

If non-null specifies which long-press key should be selected initially in the long-press menu. If null, the first longPressKeyIds element is the implied default key.

Link copied to clipboard

If non-null this is the list of long press keys. Ignored for hardware layouts.

Link copied to clipboard

If non-null this is the list of multi-tap keys.

Link copied to clipboard
open override val origin: SourceFileRef

The origin of this component. Is guaranteed to either be the ref of the root keyboard3 file, or a ref returned by the configured import resolver of the compilation.

Link copied to clipboard

If non-null this key outputs this value upon key release.

Link copied to clipboard

If true this key attempts to fill remaining space in a row. Has no effect if there is no room to grow left. Ignored for hardware layouts.

Link copied to clipboard

Specifies the relative width to other keys, can be thought of like a weight. Keys by default have a width of 1.0. To e.g. instruct the layouter to make this key twice as wide as other keys, a width of 2.0 can be used. Must not be <= 0.0. Ignored for hardware layouts.