class

MKeyCap

Module
Miri
Header
#include "Miri/Widgets/MKeyCap.h"
Namespace
Miri

Public functions

ReturnsNameDescription
MIRI_WIDGET_ARGS
voidSetLabel
std::stringGetLabel
voidSetState
EKeyCapStateGetState
MiriVec2ComputeDesiredSize
int32_tOnPaint
boolCanCacheDesiredSizeThe cap is as wide as its label measures, and the label attribute owns this widget, so a new label invalidates before the next pass.
boolCanRetainPaintA leaf with no hover, no focus ring and no clock: the whole picture is the label and the state, and both attributes own this widget, so a write invalidates before the next pass.
const char*GetTypeName

Function details

MIRI_WIDGET_ARGS

C++
MIRI_WIDGET_ARGS(MKeyCap) MIRI_ATTR(std::string, Label) MIRI_ATTR(EKeyCapState, State) MIRI_WIDGET_ARGS_END() void Construct(const CArguments& args)

SetLabel

C++
void SetLabel(const std::string& label)

GetLabel

C++
std::string GetLabel() const

SetState

C++
void SetState(EKeyCapState state)

GetState

C++
EKeyCapState GetState() const

ComputeDesiredSize

C++
MiriVec2 ComputeDesiredSize(float scale) const override

OnPaint

C++
int32_t OnPaint(const CMiriPaintArgs& args, const CGeometry& geo, CMiriRenderer& renderer, int32_t layerId) const override

CanCacheDesiredSize

C++
bool CanCacheDesiredSize() const override

The cap is as wide as its label measures, and the label attribute owns this widget, so a new label invalidates before the next pass.

CanRetainPaint

C++
bool CanRetainPaint() const override

A leaf with no hover, no focus ring and no clock: the whole picture is the label and the state, and both attributes own this widget, so a write invalidates before the next pass. Only a bound one can change with nothing to see.

GetTypeName

C++
const char* GetTypeName() const override
Generated from Miri/Widgets/MKeyCap.h via miri.json · Dec 5, 2026Version 1.1.0