Based on the $:/core/ui/KeyboardShortcuts/toggle-sidebar
, I tried this code
<$list filter="[[$:/state/SampleReveal2]is[missing]] [{$:/state/SampleReveal2}removeprefix[yes]]" emptyMessage=""" <$action-setfield $tiddler="$:/state/SampleReveal2" text="show"/> """>
<$action-setfield $tiddler="$:/state/SampleReveal2" text="show"/>
</$list>
With this, I was able to show the contents of the reveal widget using keyboard shortcut I set, if it was already in hidden state .
Then I created another tiddler with this code - which hides the text when its already revealed.
<$list filter="[[$:/state/SampleReveal2]is[missing]] [{$:/state/SampleReveal2}removeprefix[yes]]" emptyMessage=""" <$action-setfield $tiddler="$:/state/SampleReveal2" text="hide"/> """>
<$action-setfield $tiddler="$:/state/SampleReveal2" text="hide"/>
</$list>
I gave different shortcuts for both.
But only one shortcut will function at a time. I will have to delete one of them for the other one to work
Any suggestions?