title: $:/core/macros/keyboard-driven-input tags: $:/tags/Macro \procedure prefix.bracket() [ \procedure suffix.bracket() ] \function tf.change-input-tab.next-tab() [[all]addprefixaddsuffixaddsuffix[shadows+tiddlers]addsuffixaddsuffix[tag!has]addsuffixaddsuffix[draft.of]addsuffixaddsuffixaddsuffix[]addsuffixaddsuffix[ :else]addsuffixaddsuffixaddsuffixaddsuffixaddsuffix[match]addsuffixaddsuffix[after]addsuffixaddsuffix[then]addsuffixaddsuffix[ :else]addsuffixaddsuffixaddsuffixaddsuffixaddsuffix[match]addsuffixaddsuffix[before]addsuffixaddsuffix[then]addsuffix] \procedure change-input-tab(stateTitle,tag,beforeafter,defaultState,actions) \whitespace trim <$set name="tabsList" filter="[!is[blank]enlist-input[]] :else[all[shadows+tiddlers]tag!has[draft.of]]"> <$let currentState={{{ [!is[missing]get[text]] :else[] }}} firstTab={{{ [enlistnth[1]] }}} lastTab={{{ [enlistlast[]] }}} nextTabSubFilter=<> nextTab={{{ [subfilter] }}} > <$action-setfield $tiddler=<> text=<>/> <> \end \procedure keyboard-input-actions() \whitespace trim <%if [match[]] %> <$action-setfield $tiddler=<> text={{{ [get] }}}/> <% endif %> <%if [!match[]] %> <$action-setfield $tiddler=<> text={{{ [getindex] }}}/> <% endif %> \end \procedure input-next-actions-inner() \whitespace trim <%if [minlength[1]] %> <$action-setfield $tiddler=<> text=<>/> <%if [match[]] %> <$action-setfield $tiddler=<> $field=<> $value={{{ [] :and[splitregexp[(?:.(?!-))+$]] }}}/> <% endif %> <%if [!match[]] %> <$action-setfield $tiddler=<> $index=<> $value={{{ [] :and[splitregexp[(?:.(?!-))+$]] }}}/> <% endif %> <$action-setfield $tiddler=<> text="yes"/> <% endif %> \end \procedure input-next-actions-after() \whitespace trim <%if [get[text]minlength] [match[0]] %> <$let userInput={{{ [get[text]] }}} selectedItem={{{ [get[text]] }}} configTiddler={{{ [subfilter] }}} primaryListFilter={{{ [get] }}} secondaryListFilter={{{ [get] }}} > <$set name="filteredList" filter="[subfilteraddsuffix[-primaryList]] :all[subfilteraddsuffix[-secondaryList]]" > <$let nextItem={{{ [enlistafter] :else[enlistnth[1]] }}} firstItem={{{ [enlistnth[1]] }}} lastItem={{{ [enlistlast[]] }}} > <%if [match!match] [!match!match] %> <> <%elseif [match!match] %> <$set name="nextItem" value={{{ [addsuffix[-userInput]] }}}> <> <%elseif [matchmatch] %> <$set name="nextItem" value={{{ [addsuffix[-userInput]] }}}> <> <% endif %> <% endif %> \end \procedure input-next-actions-before() \whitespace trim <%if [get[text]minlength] [match[0]] %> <$let userInput={{{ [get[text]] }}} selectedItem={{{ [get[text]] }}} configTiddler={{{ [subfilter] }}} primaryListFilter={{{ [get] }}} secondaryListFilter={{{ [get] }}} > <$set name="filteredList" filter="[subfilteraddsuffix[-primaryList]] :all[subfilteraddsuffix[-secondaryList]]" > <$let nextItem={{{ [enlistbefore] :else[enlistreverse[]nth[1]] }}} firstItem={{{ [enlistnth[1]] }}} lastItem={{{ [enlistlast[]] }}} > <%if [match!match] %> <$set name="nextItem" value={{{ [addsuffix[-userInput]] }}}> <> <%elseif [match!match] [!match!match] %> <> <%elseif [matchmatch] %> <$set name="nextItem" value={{{ [addsuffix[-userInput]] }}}> <> <% endif %> <% endif %> \end \procedure keyboard-driven-input(tiddler,storeTitle,field:"text",index:"",tag:"input",type,focus:"",inputAcceptActions,inputAcceptVariantActions,inputCancelActions,placeholder:"",default:"",class,focusPopup,rows,minHeight,tabindex,size,autoHeight,filterMinLength:"0",refreshTitle,selectionStateTitle,cancelPopups:"",configTiddlerFilter,firstSearchFilterField:"first-search-filter",secondSearchFilterField:"second-search-filter") \whitespace trim <$keyboard key="((input-accept))" actions=<>> <$keyboard key="((input-accept-variant))" actions=<>> <$keyboard key="((input-up))" actions=<>> <$keyboard key="((input-down))" actions=<>> <$keyboard key="((input-cancel))" actions=<>> <$edit-text tiddler=<> field=<> index=<> inputActions=<> tag=<> class=<> placeholder=<> default=<> focusPopup=<> focus=<> type=<> rows=<> minHeight=<> tabindex=<> size=<> autoHeight=<> refreshTitle=<> cancelPopups=<> /> \end