Triggering reveal widget with action widgets

If you look at this demo wiki - https://arsheth.tiddlyhost.com/

@Alvaro I have used some keyboard shortcuts based on BTC’s http://tiddlywiki-keyboard.tiddlyspot.com/

For example, if you use Alt+M shortcut , the focused tiddler will go into maximized state and vice versa. Can such a method be used to create a keyboard shortcut to open the reveal widget of the focused tiddler only .

image

This was my first question in any of the tiddlywiki community groups. Also this was my first interaction in any of the software community groups. Due to lack of prior experience, I tagged you while asking that question. But you were kind enough to reply me. Interestingly that was also your last comment in discord server.

Discord isn’t yet part of my regular online routine, but I’m happy to be tagged there, and always enjoy poking around when I do visit.

With the focus you have solved the half of problem, now you only should follow the hints about the qualify macro and how triggering actions. You have a working example of triggering action(but with button) together a qualify macro in the info button, see the variable tiddlerInfoState
https://tiddlywiki.com/#%24%3A%2Fcore%2Fui%2FViewTemplate:%24%3A%2Fcore%2Fui%2FViewTemplate%20%24%3A%2Fcore%2Fui%2FButtons%2Finfo

You will have to do the equivalent in shortcut triggering of button widget
<$button set=<<tiddlerInfoState>> setTo=

1 Like

It is possible to select the focused tiddler:

<$reveal type=“match” state="$:/HistoryList!!current-tiddler" text=<<currentTiddler>>>

place sidebar here

</$reveal>

2 Likes

Thank you @Alvaro and @buggyj for your suggestions. I must admit that its little tough for me to solve this with my current TW skills. I will read about your suggestions and will revisit this thread once I am near some solutions

Today I learned (TIL) there’s a Discord for TW. I had no idea!

Thanks, @arunnbabu81!

I was using this code to create a keyboard shortcut for a reveal widget as mentioned in this discussion for invoking a sidetabs to the right side of the tiddler body.

Today, based on this discussion, I changed the code for the reveal widget as mentioned here. Code used is given below.

<$let stateID={{{ [[$:/temp/abc/]addsuffix{!!title}addsuffix<qualify>] }}}>
   <$reveal type="nomatch" state=<<stateID>> text="show">
      <$button set=<<stateID>> setTo="show" class="mybutton" >
         {{$:/core/images/info-button}}
      </$button>
   </$reveal>
   <$reveal type="match" state=<<stateID>> text="show">
      <$button set=<<stateID>> setTo="hide" class="mybutton" >
         {{$:/core/images/info-button}}
      </$button>
<$list filter="[all[current]!is[system]!is[shadow]!tag[$:/tags/SideBar]!tag[Journal]!tag[$:/tags/ViewTemplate]!tag[$:/tags/Stylesheet]!tag[tweaks]!TheBrain[no]!has[page-cover]]">
<div class="rightside">

{{||Bottom Tabs for viewtemplate - without folding}}
</div>

<style>
[data-tiddler-title='{{!!title}}'] .tc-tiddler-body {
  border:1px solid transparent;
  width:50%;
}
[data-tiddler-title='{{!!title}}'] .rightside {
  border:1px solid transparent;
  width:50%;
  position: relative;
  float:right;
  right:0;
	}

</style>
</$list>
</$reveal>

<style>
.mybutton {float:right}
.mybutton {margin-top: -25px}
</style>

So now the keyboard shortcut have stopped working.


As mentioned before by @EricShulman in one of the earlier post

I wil have to use a filter with [prefix[StateTiddlerTitle]] to modify the code used for keyboard shortcut.

How to modify the code given below to include the prefix part ?

<$action-setfield $tiddler="$:/state/SampleReveal2" text={{{ [{$:/state/SampleReveal2}match[hide]then[show]else[hide]] }}}/>