Keyboard widget

115 views
Skip to first unread message

clutterstack

unread,
Jan 23, 2021, 11:02:39 PM1/23/21
to TiddlyWiki

Hi all,

I have, in some of my macros, three nested keyboard widgets to listen for three different key combinations. I'm just wondering whether this is the best way to accomplish that. I don't think I want to assign keyboard shortcuts for the whole wiki, because I may want different actions for the same key or key combination, based on the event target.

Am I missing something?

Best,
Chris

TW Tones

unread,
Jan 24, 2021, 4:58:22 PM1/24/21
to TiddlyWiki
Clutterstack,

I am no expert in keyboard shortcuts for sure, but with 5.1.23 we can now use the modifier keys, so alt- shift- ctrl- can be interrogated in the actions macro if appropriate you can then use one key, 3-4 modifier keys so perhaps a global short cut that responds to conditions and modifier keys is another approach.

Regards
Tones

clutterstack

unread,
Jan 25, 2021, 7:56:55 PM1/25/21
to TiddlyWiki
Thanks Tones,

I had another look at the global keyboard shortcuts, and I haven't tried it, but the presence of duplicate key combinations in the shortcut list does make me hopeful that I might be able to just add more duplicate global shortcuts and have them work appropriately with a macro that only works under, as you say, given conditions. It does sound like something that could require careful thought to avoid conflict. But definitely something to think about!

For now, I think I'll leave my nested keyboard widgets in place, since they work and haven't caused me any grief, unless it's through a performance hit. I certainly have other optimisations I can focus on!

Best,
Chris

clutterstack

unread,
Jan 25, 2021, 8:12:03 PM1/25/21
to TiddlyWiki
Haha, I'm just looking at the source for the keyboard-driven-input macro and it has five nested keyboard widgets, so I venture a guess that there's not an obviously better way just now.

Best,
Chris

TW Tones

unread,
Jan 25, 2021, 8:24:56 PM1/25/21
to TiddlyWiki
Have you found a easy to use way to create your own global shortcuts?

I found a few times trying to understand the keyboard shortcuts some gaps in the doco. First I would like to understand, then update the doco.

Tones

clutterstack

unread,
Jan 25, 2021, 10:08:09 PM1/25/21
to TiddlyWiki
Hi Tones,

To test, I made one to pop up HelloThere in a modal, by following the directions in the Keyboard Shortcut Tiddler tiddler.

Overview: I had to create two tiddlers, then go into Control Panel -> Keyboard Shortcuts to set the key combination for the shortcut.

I called my shortcut "canscut".

First I made a tiddler with an arbitrary title, whose text field contains the action I want the shortcut to invoke; in this case:

<$action-sendmessage $message="tm-modal" $param="HelloThere" />

I added a field with name key and value ((canscut)), and tagged it $:/tags/KeyboardShortcut. That takes care of setting up the actions and the reference key so the shortcut can be referred to in macros without being opinionated on what its specific key combo should be.

Then I created the tiddler $:/config/ShortcutInfo/canscut -- I didn't have to put anything into it; that's enough to add a row into the appropriate part of Control Panel -> Keyboard Shortcuts, so that the key combo can be set interactively. Once I used that interface to set the key combination, the tiddler $:/config/shortcuts/canscut was generated with shift-cmd-G in the text field.

And voila, now if I hit shift-cmd-G, I get the HelloThere tiddler in a modal.

Hope that helps,
Chris

TW Tones

unread,
Jan 25, 2021, 11:42:12 PM1/25/21
to TiddlyWiki
Thanks Chris,

I will work through your instructions, but do I read your notes to suggest what I expected that there is a step that can only be interactive?

If so how do we distribute shortcut(s) ?

Regrds
Tones

Chris Nicoll

unread,
Jan 26, 2021, 12:51:19 AM1/26/21
to tiddl...@googlegroups.com
Hi Tones,

I expect you can write the config tiddler yourself, if you want it preset, without the control panel step.

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/QMBkpZI0t34/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/6b27f1a7-a337-440c-af4b-8cdec4f5cd90n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages