This is potentially more suited to the dev forum but I am posting here as 
it may be of interest to others.

I would like to discuss enhancing the core keyboard widget 
( https://tiddlywiki.com/#KeyboardWidget ), at first as a plugin and later 
potentially for the core. Currently the widget only supports adding one 
keyboard shortcut at a time. So if you need to capture a few keys you end 
up with a crazy number of widgets quite quickly (example below)  with each 
one adding a DOM element.

<$keyboard key="ctrl+enter" actions=<<save-edit-bullet-actions>> >
<$keyboard key="tab" actions=<<indent-bullet-actions>> >
<$keyboard key="shift+tab" actions=<<unindent-bullet-actions>> >
<$keyboard key="ctrl+down" actions=<<focus-lower-bullet-actions>> >
<$keyboard key="ctrl+up" actions=<<focus-higher-bullet-actions>> >
<$keyboard key="alt+down" actions=<<demote-bullet-actions>> >
<$keyboard key="alt+up" actions=<<promote-bullet-actions>> >
<$keyboard key="enter" actions=<<save-bullet-actions>> >
<$keyboard key="alt+enter" actions=<<save-longform-actions>> >
<$keyboard key="escape" actions=<<cancel-edit-bullet-actions>> >
<$keyboard key="delete" actions=<<delete-bullet-actions>> >
<$keyboard key="alt+r" actions=<<rename-bullet-actions>> >
<$edit-text tag="textarea" autoHeight="yes" minHeight="1em" focus="yes"/>
</$keyboard>
</$keyboard>
</$keyboard>
</$keyboard>
</$keyboard>
</$keyboard>
</$keyboard>
</$keyboard>
</$keyboard>
</$keyboard>
</$keyboard>
</$keyboard>


I have considered having a list widget that loops through some tagged 
tiddlers to setup multiple keyboard widgets, and while a step in the right 
direction,  that too feels inefficient. One keyboard widget should be able 
to handle multiple assignments. 

The question is, what is an end-user friendly way to declare multiple 
key-action mappings when calling the widget?

One option is to pass it a filter that identifies tiddlers with key-action 
mappings, similar to what $:/tags/KeyboardShortcut does for the core.
( https://tiddlywiki.com/#Keyboard%20Shortcut%20Tiddler )

<$keyboard $filter="[tag[my-keyboard-mapping-tag]]"/>


Thoughts?

Saq





















-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/fd28965f-9ea8-455e-8cfb-a7056288a42d%40googlegroups.com.

Reply via email to