MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ press_and_hold()

Context & MayaFlux::Portal::Forma::Context::press_and_hold ( uint32_t  id,
IO::Keys  key,
KeyFn  fn 
)

Register a key handler that fires on the initial press and on every repeat, with a deterministic first event.

on_held already fires on the initial KEY_PRESSED and on each repeat, so this registers it alone; also registering on_press would count the initial press twice, since every listener on a key sees every event. One fire per physical press, a clean repeat cadence after.

Parameters
idElement id to bind to.
keyThe key to listen for.
fnCallback receiving element id, fired once on press and again on each repeat tick.
Returns
*this for chaining.

Definition at line 213 of file Context.cpp.

214{
215 on_held(id, key, std::move(fn));
216 return *this;
217}
void on_held(uint32_t id, IO::Keys key, KeyFn fn)
Called repeatedly while a key is held and the element has focus.
Definition Context.cpp:105

References on_held().

Referenced by MayaFlux::Portal::Forma::TextField::wire().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: