I'm running into what seems to be a scope issue and not sure how to work around it. I'm hoping that some experts here might see what I'm doing wrong.
I have an edit-text widget for the user to enter a new title name, and then I need to append a date to the end of it and create a new tiddler for it. I can have that work with the button no problem, but can't figure out how to add they keyboard shortcut properly.
This works from a button standpoint:
\define newtiddlername() $(mytitle)$ $(now)$
\define addnewtiddler() <$action-createtiddler $basetitle=<<newtiddlername>>/>
<$edit-text tiddler="$:/temp/mytitle" tag="input" default=""/>
<$vars mytitle={{$:/temp/mytitle}}>
<$button actions=<<addnewtiddler>>>
Add
</$button>
</$vars>
but this doesn't work
\define newtiddlername() $(mytitle)$ $(now)$
\define addnewtiddler() <$action-createtiddler $basetitle=<<newtiddlername>>/>
<$keyboard key="enter" actions=<<addnewtiddler>>>
<$edit-text tiddler="$:/temp/mytitle" tag="input" default=""/>
<$vars mytitle={{$:/temp/mytitle}}>
<$button actions=<<addnewtiddler>>>
Add
</$button>
</$vars>
</$keyboard>
I tried moving the vars outside of the keyboard, but then each character typed makes the input box lose focus...
Ideas?