class

MKeyCaptureField

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

Properties

TypeNameDescription
MiriDelegate<void(const CInputChord&)>OnChordCapturedA captured keyboard chord; an empty chord means Backspace cleared it.
MiriDelegate<void(const std::string&)>OnExternalCapturedA captured mouse button, wheel notch or gamepad button, by its cap label.
MiriDelegate<void(const CKeyCaptureResult&)>OnCapturedEvery finished capture, typed. Hosts that store mouse bindings read this; OnChordCaptured and OnExternalCaptured still fire as before.
MiriDelegate<void()>OnCaptureCancelled

Public functions

ReturnsNameDescription
MIRI_WIDGET_ARGS
voidSetChord
const CInputChord&GetChord
voidSetExternalLabelA binding that is not a keyboard chord (a mouse or gamepad button), shown as one cap with this label.
const std::string&GetExternalLabel
voidSetConflictNames the binding this one collides with; empty clears the conflict.
voidSetLeadingIconA Lucide glyph drawn before the caps — the device the binding reads (keyboard, gamepad, mouse).
boolHasConflict
voidSetSelected
voidBeginCaptureStarts listening and takes keyboard focus, so the next key reaches this field and not the editor's shortcuts, however the capture was started (a click, Enter, or a host's "+" that just rebuilt the row).
voidCancelCapture
voidSetEscapeKeysKeys that cancel instead of binding (UE's EscapeKeys).
voidSetClearKeysKeys that clear the binding instead of binding.
voidSetAllowModifierKeysA lone Shift, Ctrl, Alt or Command released with nothing pressed in between becomes the binding (UE's bAllowModifierKeysAsSelectedKeys).
voidSetAllowMouseCaptureThe left button and the wheel become bindable while listening.
boolIsCapturing
voidCaptureExternalEnds a capture with a non-keyboard binding (a gamepad button).
std::vector<std::string>CapsThe caps the field shows for its binding ("Ctrl", "Shift", "K").
EKeyCapStateGetStateThe binding as the key-cap states name it: capturing, conflict, placeholder (nothing bound) or default.
boolIsFocusable
boolConsumesTab
boolCapturesAllKeys
boolOnActivate
floatGetFocusRadius
boolCanRetainPaintThe capture prompt pulses on a clock, which a replay would freeze.
MiriVec2ComputeDesiredSize
int32_tOnPaint
CReplyOnMouseButtonDown
CReplyOnMouseWheel
CReplyOnKeyDown
CReplyOnKeyUp
voidOnFocusLost
const char*GetTypeName
const char*MouseButtonLabel

Function details

MIRI_WIDGET_ARGS

C++
MIRI_WIDGET_ARGS(MKeyCaptureField) MIRI_ARG(CInputChord, Chord) MIRI_ARG(std::string, CapturePrompt) MIRI_ARG(std::string, EmptyLabel) MIRI_WIDGET_ARGS_END() void Construct(const CArguments& args)

SetChord

C++
void SetChord(const CInputChord& chord)

GetChord

C++
const CInputChord& GetChord() const

SetExternalLabel

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

A binding that is not a keyboard chord (a mouse or gamepad button), shown as one cap with this label. SetChord clears it.

GetExternalLabel

C++
const std::string& GetExternalLabel() const

SetConflict

C++
void SetConflict(const std::string& conflictsWith)

Names the binding this one collides with; empty clears the conflict.

SetLeadingIcon

C++
void SetLeadingIcon(const std::string& glyph)

A Lucide glyph drawn before the caps — the device the binding reads (keyboard, gamepad, mouse). Empty draws none.

HasConflict

C++
bool HasConflict() const

SetSelected

C++
void SetSelected(bool selected)

BeginCapture

C++
void BeginCapture()

Starts listening and takes keyboard focus, so the next key reaches this field and not the editor's shortcuts, however the capture was started (a click, Enter, or a host's "+" that just rebuilt the row).

CancelCapture

C++
void CancelCapture()

SetEscapeKeys

C++
void SetEscapeKeys(std::vector<EKey> keys)

Keys that cancel instead of binding (UE's EscapeKeys). Empty lets Escape be bound; cancel is then a click elsewhere. Default: Escape.

SetClearKeys

C++
void SetClearKeys(std::vector<EKey> keys)

Keys that clear the binding instead of binding. Default: Backspace.

SetAllowModifierKeys

C++
void SetAllowModifierKeys(bool allow)

A lone Shift, Ctrl, Alt or Command released with nothing pressed in between becomes the binding (UE's bAllowModifierKeysAsSelectedKeys).

SetAllowMouseCapture

C++
void SetAllowMouseCapture(bool allow)

The left button and the wheel become bindable while listening.

IsCapturing

C++
bool IsCapturing() const

CaptureExternal

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

Ends a capture with a non-keyboard binding (a gamepad button).

Caps

C++
std::vector<std::string> Caps() const

The caps the field shows for its binding ("Ctrl", "Shift", "K").

GetState

C++
EKeyCapState GetState() const

The binding as the key-cap states name it: capturing, conflict, placeholder (nothing bound) or default.

IsFocusable

C++
bool IsFocusable() const override

ConsumesTab

C++
bool ConsumesTab() const override

CapturesAllKeys

C++
bool CapturesAllKeys() const override

OnActivate

C++
bool OnActivate() override

GetFocusRadius

C++
float GetFocusRadius() const override

CanRetainPaint

C++
bool CanRetainPaint() const override

The capture prompt pulses on a clock, which a replay would freeze.

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

OnMouseButtonDown

C++
CReply OnMouseButtonDown(const CGeometry& geo, const CPointerEvent& event) override

OnMouseWheel

C++
CReply OnMouseWheel(const CGeometry& geo, const CPointerEvent& event) override

OnKeyDown

C++
CReply OnKeyDown(const CGeometry& geo, const CKeyEvent& event) override

OnKeyUp

C++
CReply OnKeyUp(const CGeometry& geo, const CKeyEvent& event) override

OnFocusLost

C++
void OnFocusLost(const CFocusEvent& event) override

GetTypeName

C++
const char* GetTypeName() const override

MouseButtonLabel

C++
static const char* MouseButtonLabel(EMouseButton button)
Generated from Miri/Widgets/MKeyCaptureField.h via miri.json · Dec 5, 2026Version 1.1.0