Using the keyboord plugin, is it possible to have tiddler-specific keyboard shortcuts?

283 views
Skip to first unread message

nakedmind

unread,
Aug 20, 2018, 11:38:35 PM8/20/18
to TiddlyWiki
Hi there,

I'm quite new to TW, but already I am finding it very very useful.  I've set aside some coding projects I was working on and
spent the whole of last week learning it. Also spent a lot of time trying to customize it.

I have a created a task management setup based on this tutorial: https://www.didaxy.com/making-a-pop-out-task-tracker-in-tiddlywiki
I have created a tiddler that serves as an entry point for my task setup.
It has tabs for active, done, and on-hold tasks plus a tab that lists all the created tasks.
It also has an input box for adding tasks and a dropdown list for selecting a "task folder".

I have also installed the latest prerelease version of the keyboord plugin and it's working really well so far.
I have copied the shortcuts for navigating the story list, editing/cloning/closing selected tiddler, etc.
And I have also created my own shortcuts such as for opening the task manager tiddler.

Now on to my question.

Is is it possible to create shortcuts that are only active while the task manager tiddler is selected?
Selecting another tiddler will deactivate the shortcuts.
Basically, I want to navigate the different parts of the task manager tiddler using keyboard shortcuts.

BurningTreeC

unread,
Aug 21, 2018, 3:29:57 AM8/21/18
to TiddlyWiki
Hi @nakedmind
 What you ask is possible in two different ways, maybe more. AND it's a very good idea :)
The way I would use:

When selecting a tiddler, check in the corresponding keyboard shortcut which selects the tiddler ($:/KeyboardShortcut/navigate-next or navigate-previous) if the title of the tiddler is your task manager.
Then if it is, you can deactivate those shortcuts that conflict with your task-manager shortcuts by removing the tag $:/tags/KeyboardShortcut from them. With the same check you add those tags to your task-manager shortcuts.
You then need another check, if the navigated tiddler is NOT your task-manager AND if the shortcut-tiddlers where you remove the tags still don't have the tags.

I'll create an Example on https://burningtreec.github.io/KeeBoord and post the link here

Note that the KeeBoord prerelease on GitHub still changes from day to day, so it's worth to keep an eye on it from time to time to stay updated

all the best, BTC

BurningTreeC

unread,
Aug 21, 2018, 5:19:53 AM8/21/18
to TiddlyWiki
@nakedmind

... Your idea is that good, I've created a mechanism for it

Look at https://burningtreec.github.io/KeeBoord , I've put an explanatory Tiddler on top and left the config Tiddlers open so you can test
Currently it works for Navigation only, but I'll add the mechanism when a tiddler closes, opens, changes to edit mode and so on ...

BTC

nakedmind

unread,
Aug 21, 2018, 5:20:20 AM8/21/18
to TiddlyWiki
Thanks! I'm gonna wait for that. In the meantime, I'll try to see what I can come up with using the approach you suggested.

BurningTreeC

unread,
Aug 21, 2018, 5:59:52 AM8/21/18
to TiddlyWiki
Thanks! I'm gonna wait for that. In the meantime, I'll try to see what I can come up with using the approach you suggested.


Now the per-Tiddler mechanism handles it for all cases. It still needs testing though :)

all the best, BTC 

nakedmind

unread,
Aug 21, 2018, 7:34:08 AM8/21/18
to TiddlyWiki
Thanks for the quick response! I tested it like you said and I would like to test it on my setup. Is this change already integrated in the prerelease version?

BurningTreeC

unread,
Aug 21, 2018, 7:47:51 AM8/21/18
to TiddlyWiki
Yes it's available online, in both the github repository and the plugin tiddlywiki (burningtreec.github.io/KeeBoord)

nakedmind

unread,
Aug 21, 2018, 8:46:19 AM8/21/18
to TiddlyWiki
Ok I'm testing it right now on a local empty tiddlywiki. It's working well except for a few things:

1. There is a bug wherein the tiddler is selected but the shortcut is not activated. Let's say I have another tiddler selected. Clicking on the main dropdown menu of the shortcut's target tiddler selects the tiddler but does not activate the shortcut.

2. Seems related to #1. Let's say I have another tiddler selected and I want to edit the target tiddler. Clicking on the edit button of the target tiddler will not activate the shortcut. Only when I exit the edit mode will the shortcut be activated. On the other hand, when the target tiddler is the one selected and the tiddler's shortcut is active, clicking on the edit button of another tiddler will immediately deactivate the tiddler-specific shortcut before entering edit mode. And not after exiting.

3. When I initially create a new tiddler-specific shortcut, it will be active until I select and then deselect the shortcut's target tiddler. So I can have a situation in which an unwanted shortcut is active which could cause confusion. A possible workaround is to create the shortcut first without tagging it with $:/tags/KeyboardShortcut.

That's all so far.

nakedmind

unread,
Aug 21, 2018, 8:56:25 AM8/21/18
to TiddlyWiki
Just a suggestion. Instead of having another tiddler to specify which shortcuts to activate/deactivate, how about using a field in the shortcut tiddler to specify the names of tiddlers where the shortcut is active. If a shortcut tiddler has no such field, then it's a global shortcut.

BurningTreeC

unread,
Aug 21, 2018, 9:12:22 AM8/21/18
to TiddlyWiki
Ok I'm testing it right now on a local empty tiddlywiki. It's working well except for a few things:

1. There is a bug wherein the tiddler is selected but the shortcut is not activated. Let's say I have another tiddler selected. Clicking on the main dropdown menu of the shortcut's target tiddler selects the tiddler but does not activate the shortcut.

Thanks for reporting, I've fixed that and the fix is online 

2. Seems related to #1. Let's say I have another tiddler selected and I want to edit the target tiddler. Clicking on the edit button of the target tiddler will not activate the shortcut. Only when I exit the edit mode will the shortcut be activated. On the other hand, when the target tiddler is the one selected and the tiddler's shortcut is active, clicking on the edit button of another tiddler will immediately deactivate the tiddler-specific shortcut before entering edit mode. And not after exiting.

Yes it deactivates the shortcuts for the tiddler in edit-mode, because that tiddler has a different title. If the tiddler-title is "hello" then it is "Draft of 'hello'" when editing 

3. When I initially create a new tiddler-specific shortcut, it will be active until I select and then deselect the shortcut's target tiddler. So I can have a situation in which an unwanted shortcut is active which could cause confusion. A possible workaround is to create the shortcut first without tagging it with $:/tags/KeyboardShortcut.

That would happen only once, when creating the shortcut for the first time. If it's becoming an issue, I can add something that checks for this, but I don't think it's that important 

Just a suggestion. Instead of having another tiddler to specify which shortcuts to activate/deactivate, how about using a field in the shortcut tiddler to specify the names of tiddlers where the shortcut is active. If a shortcut tiddler has no such field, then it's a global shortcut. 

Right, that would be better :)
I'll see if I can implement it that way, thank you very much for testing and your ideas!

BTC 

nakedmind

unread,
Aug 21, 2018, 8:21:15 PM8/21/18
to TiddlyWiki
3. When I initially create a new tiddler-specific shortcut, it will be active until I select and then deselect the shortcut's target tiddler. So I can have a situation in which an unwanted shortcut is active which could cause confusion. A possible workaround is to create the shortcut first without tagging it with $:/tags/KeyboardShortcut.

That would happen only once, when creating the shortcut for the first time. If it's becoming an issue, I can add something that checks for this, but I don't think it's that important 

Yes that's a minor issue that can be easily dealt with.
 
thank you very much for testing and your ideas!

 I should be the one to thank you! Your plugin has been heaven-sent :) I am now able to use only my keyboard most of the time.

Actually, I tried tiddlywiki earlier this year around Feb. I saw its potential in terms of being my go-to tool when it comes to managing all the digital stuff I have accumulated and continue to accumulate. But I had to put it aside because it was not keyboard-friendly. But now, with your plugin, it's very promising!

nakedmind

unread,
Aug 21, 2018, 10:59:17 PM8/21/18
to TiddlyWiki
Another issue I'm encountering is the TAB focus.

When a tiddler is selected via up/down arrow keys, is it possible to have the TAB key focus shifted to the selected tiddler; i.e., when I press the TAB key repeatedly, focus will move starting from the first focusable element of the selected tiddler.

Currently, let's say I navigate towards the bottom tiddler of the story list, when I press TAB with the intention of stepping thru the elements of the bottom tiddler, I find that the focus is currently in an element of e.g. the topmost tiddler. If there are a lot of tiddlers opened, I will have to press TAB a lot just to move focus to the bottom tiddler. In this case, I just give up and use the mouse.

BurningTreeC

unread,
Aug 22, 2018, 1:54:12 PM8/22/18
to TiddlyWiki
Another issue I'm encountering is the TAB focus.

When a tiddler is selected via up/down arrow keys, is it possible to have the TAB key focus shifted to the selected tiddler; i.e., when I press the TAB key repeatedly, focus will move starting from the first focusable element of the selected tiddler.

Currently, let's say I navigate towards the bottom tiddler of the story list, when I press TAB with the intention of stepping thru the elements of the bottom tiddler, I find that the focus is currently in an element of e.g. the topmost tiddler. If there are a lot of tiddlers opened, I will have to press TAB a lot just to move focus to the bottom tiddler. In this case, I just give up and use the mouse.

Thanks. I think I've addressed parts of what you describe. The updates are online, if you want to test

BTC

nakedmind

unread,
Aug 22, 2018, 9:50:33 PM8/22/18
to TiddlyWiki


Thanks. I think I've addressed parts of what you describe. The updates are online, if you want to test


Thanks! Really appreciate the work you've been doing. Im gonna test it now and give you feedback.

Btw the tiddler-specific shortcuts are working really well so far :) Nice work!

My task manager tiddler has several tabs for active, done, and on-hold.
So I've added shortcuts ctrl-1, ctrl-2, and ctrl-3 to display the contents of each tab.
And it's working really well.Yay!

And I think if the issue with the TAB key focus is addressed, it will really make tw's keyboard workflow
a lot smoother.

nakedmind

unread,
Aug 22, 2018, 10:14:14 PM8/22/18
to TiddlyWiki


Thanks. I think I've addressed parts of what you describe. The updates are online, if you want to test


Thanks! Really appreciate the work you've been doing. Im gonna test it now and give you feedback.


I tested your latest  update on an empty wiki and I'm getting an internal javascript error. I'm using the latest version of tiddly desktop. This is what I did. I downloaded an empty, dragged your plugin, saved and reloaded the wiki. And then the error shows up.



And here's the output of the developer tools console:




BurningTreeC

unread,
Aug 23, 2018, 7:19:26 AM8/23/18
to TiddlyWiki
Thanks for reporting, I left something half-finished there. I hope it's fixed now ... 

nakedmind

unread,
Sep 5, 2018, 10:10:04 PM9/5/18
to TiddlyWiki
Hi again!

When selecting tags from the dropdown list, is it possible to make the up and down arrows update the tag input box value with the selected tag? 

This will allow to easily create a new tag based on an existing tag, I can just select the tag using the arrow keys, and then edit the value in the tag input box. 
Then I press Enter and I have a new tag. 

This also does away with having a separate Shift-Enter shortcut since the input box already contains the tag I want. So just pressing Enter will add the tag.

And finally, this addresses an issue I'm encountering which is when I filter the tag dropdown list by entering a few characters in the tag input box, 
the input box is not cleared when I press shift-Enter to add the tag. So I have to manually clear the tag input box or else a new unwanted tag is created if I exit edit mode.

BurningTreeC

unread,
Sep 6, 2018, 3:52:36 AM9/6/18
to tiddl...@googlegroups.com
Hi, thanks for your feedback, it's very helpful!

Take a look at https://burningtreec.github.io/KeeBoord , I've already had adding tags clear the input field, but now selecting tags also updates the input field with the tag name as you suggested and you can add it with Enter

Edit: I have to fix some parts, will do so soon

BTC 

BurningTreeC

unread,
Sep 6, 2018, 7:50:36 AM9/6/18
to TiddlyWiki
edited my previous answer

nakedmind

unread,
Sep 6, 2018, 8:18:52 AM9/6/18
to TiddlyWiki
I will just wait for the fixes you mentioned before I try it out. Again thank you for your work on this plugin! 
I think this functionality should be part of the core.

On Thursday, 6 September 2018 19:50:36 UTC+8, BurningTreeC wrote:
edited my previous answer

BurningTreeC

unread,
Sep 6, 2018, 3:18:57 PM9/6/18
to TiddlyWiki
It should be fixed now, it's working pretty well, thanks again for your ideas!
I'm making this for my own use, too - so this is a win-win situation ;)

BTC

nakedmind

unread,
Sep 6, 2018, 8:52:22 PM9/6/18
to TiddlyWiki


On Friday, 7 September 2018 03:18:57 UTC+8, BurningTreeC wrote:

It should be fixed now, it's working pretty well, thanks again for your ideas!
I'm making this for my own use, too - so this is a win-win situation ;)

The latest update is not working on my side. I'm testing using tiddly desktop on a fresh tw file (5.1.17). The demo site is using 5.1.18-prerelease.
Installing the plugin breaks all the internal wiki links. When I click on any link except the new-tiddler, I'm being redirected to my default browser and I'm getting an internal javascript error:

Capture.JPG


BurningTreeC

unread,
Sep 7, 2018, 3:04:13 AM9/7/18
to TiddlyWiki
Yes, that will happen when trying it on a tiddlywiki older than 2 weeks, since commit https://github.com/Jermolene/TiddlyWiki5/commit/0f7ce7b67fb9a6b7c5cb944fc897eb23775ce3a8
I'm trying to develop the github KeeBoord version so that it is compatible with the coming release 5.1.18
Because of some recent changes/additions in the core, the github version is only compatible with a very recent prerelease version.
It should be sufficient to get an empty tiddlywiki from https://tiddlywiki.com/prerelease and try KeeBoord there

all the best,
BTC

nakedmind

unread,
Sep 8, 2018, 7:13:18 AM9/8/18
to TiddlyWiki
I finally tested the update using the prerelease version. 

Nice work! I especially love the top search bar and how easily I can start searching and then navigating the results. This functionality should be part of the core, replacing the sidebar search.

However, I have encountered a few issues and have some suggestions.

1. With the top search bar, there might be times when I'd like to quickly open some or all of the matching tiddlers. I'm thinking maybe having Shift-Enter as a shortcut to select a search result item without closing the search bar while pressing Enter will select the item and close the search bar.

2. In the fields dropdown, pressing Enter to add the field seems to produce confusing behavior. Because after adding a field by pressing Enter and then TAB-ing back to the field name input box and selecting a field using the arrow keys, pressing shift-Enter does not update the input box. It's still empty. What is confusing is that when I enter a field value and either press Enter or click the Add button, the selected field is added. This only happens when using Enter key to add a field.

3. Let's say I have a text input box in a tiddler, is it possible to assign a shortcut that puts focus on the input box? Or any tiddler element for that matter?

4. Once the sidebar is selected via alt-S, how can I go back to storyview via a shortcut?

Your plugin is becoming really good, it's starting to feel like I'm working on a text editor like sublime (my editor of choice), you know just using the keyboard to quickly navigate TW to find stuff or enter content. Really nice :) 

Once again thank you for your work on this! 

regards,
Eric

BurningTreeC

unread,
Sep 8, 2018, 9:03:15 AM9/8/18
to TiddlyWiki
I finally tested the update using the prerelease version. 

Nice work! I especially love the top search bar and how easily I can start searching and then navigating the results. This functionality should be part of the core, replacing the sidebar search.

However, I have encountered a few issues and have some suggestions.

1. With the top search bar, there might be times when I'd like to quickly open some or all of the matching tiddlers. I'm thinking maybe having Shift-Enter as a shortcut to select a search result item without closing the search bar while pressing Enter will select the item and close the search bar.

Hi, I will add a shortcut to open all matching tiddlers, it's pretty easy to add. Selecting single tiddlers and then opening all selected ones would be cool, too. I'll see if it's easily doable 

2. In the fields dropdown, pressing Enter to add the field seems to produce confusing behavior. Because after adding a field by pressing Enter and then TAB-ing back to the field name input box and selecting a field using the arrow keys, pressing shift-Enter does not update the input box. It's still empty. What is confusing is that when I enter a field value and either press Enter or click the Add button, the selected field is added. This only happens when using Enter key to add a field.

Currently I've only modified the tags dropdown, the fields and type dropdowns still behave like before, but they'll get the same overhaul so that they work like the tag-dropdown
 
3. Let's say I have a text input box in a tiddler, is it possible to assign a shortcut that puts focus on the input box? Or any tiddler element for that matter?


if you provide the "focus" attribute focus="yes" or focus="true" with your input box, then it focuses when the tiddler gets selected

for example: <$edit-text tiddler="my-tiddler" focus="yes"/>
 
4. Once the sidebar is selected via alt-S, how can I go back to storyview via a shortcut?

You can use the action-popup widget, which creates a popup-state tiddler, but also blurs the focused field: <$action-popup $popup="$:/state/my-needless-state-tiddler"/><$action-popup $popup="$:/state/my-needless-state-tiddler"/> (twice so that the state tiddler gets immediately deleted after creating)

put that in a tiddler tagged $:/tags/KeyboardShortcut ... add the field "key" to it and put something like alt-shift-Left in it. That should leave focus of any input field in your wiki..
 

Your plugin is becoming really good, it's starting to feel like I'm working on a text editor like sublime (my editor of choice), you know just using the keyboard to quickly navigate TW to find stuff or enter content. Really nice :) 

Once again thank you for your work on this! 

regards,
Eric

Thanks, I really appreciate your feedback! 
Reply all
Reply to author
Forward
0 new messages