Is the currentTiddler
variable set for the actions of a global keyboard shortcut?
I’m afraid that it isn’t and it makes sense, because you don’t have to edit a tiddler (or being “inside” a tiddler) when a global keyboard shortcut is being invoked.
The $:/HistoryList has a current-tiddler
field, that is updated, if you click a link somewhere. Basically whenever the story river is manipulated, the value is updated.
But it does not update if you scroll the story river. For this to happen you’ll need a plugin.
Also see: https://tiddlywiki.com/#HistoryMechanism
Thank you, that’s interesting and shows the limit of my assumption.
Therefore I would need another approach.
What I want is to create a (global) shortcut for inserting a text-snippet (ideally from the list of stamps) into the standard tiddler editor.
It works best in conjunction with a keyboard-widget, but in order to achieve this I would need to hack the standard editor template, wouldn’t I?
No. If you want to create a keyboard shortcut for the editor have a closer look at: How to create dynamic editor toolbar buttons
I noticed the topic before, but didn’t know that this covers keyboard shortcuts also (thinking preliminary of buttons only).
Excellent hint and topic, really easy to follow and have a quick success - also easy to adapt.
Would love to see more such easy-way-how-to-topics.
The how-to for creating keyboard shortcuts looks a bit more complicated to me.
It’s hard to say how it could be done better, because now I know how to (and I am reading it in another knowledge level). In the end I had to read it several times to fully understand it.
Do you mean How to create keyboard shortcuts with “more complicated”, or the shortcuts for the editor toolbar buttons.
I know, the former should be completely refactored, to make it better understandable. Since creating new global shortcuts is a very rare event, I also have to read it several times to know how it is done.
Yes, that’s right, I was referring to the creation of keyboard shortcuts.
May I suggest that there should be a step-by-step walkthrough, similar to the creation of a (temporary) toolbar button? The two options (keyboard-widget and global shortcut) are separated already, but it would be best if the manual shows the creation as in the “How to create dynamic editor toolbar buttons”.
Of course, it depends on which learning type you are, but for me it’s a lot easier to understand when I can get a real-world-example to tinker with.
Perhaps rather than a “step-by-step walkthrough” Especialy when dealing with short cuts perhaps its better to document how it works and provide a straigforward way to generate one aligned with a button, or just some actions to a shortcut.
Although we must give the information people are looking for, I think a tool to automate the process is kinder and more useful. Why should we force people to learn the intricacy for the occasional one off?