The configuration mechanism is the same for both shortcut-types
A tiddler with the prefix $:/config/ShortcutInfo/
and a unique suffix appended, like my-shortcut
, makes the new shortcut appear in the $:/ControlPanel within the Keyboard Shortcuts Tab. An optional description can be added within its text field
In the Keyboard Shortcuts Tab the key combination that should trigger the shortcut can be configured:
Look for the unique suffix defined for the new shortcut and click the button to open a popup that detects key combinations and shows the detected combination in its input fieldThe add shortcut assigns the key-combination to the shortcut
Depending on the chosen platform the configuration mechanism creates a tiddler with a specific nomenclature
$:/config/shortcuts/ + the shortcut suffix for shortcuts that will work on all platforms (operating systems)$:/config/shortcuts-(mac/not-mac/windows/not-windows/linux/not-linux)/ + the shortcut suffix for shortcuts that will work on the chosen platform only or that will not work on the excluded platform
Examples
- $:/config/shortcuts/
my-shortcut
- $:/config/shortcuts-mac/
my-shortcut
- $:/config/shortcuts-windows/
my-shortcut
- $:/config/shortcuts-linux/
my-shortcut
- $:/config/shortcuts-not-mac/
my-shortcut
- $:/config/shortcuts-not-windows/
my-shortcut
- $:/config/shortcuts-not-linux/
my-shortcut
At this point the shortcut is defined and its actions can be configured
Using the Keyboard Widget
A$keyboard
widget detects the key combinations pressed within aninput
ortextarea
field within its scope. The$keyboard
widget needs to "embrace" theinput
ortextarea
field and itskey
attribute either points to a configuration tiddler using the Key Descriptor Syntax or explicitely contains the key
<$keyboard key="((my-shortcut))" actions='<$action-setfield $tiddler="my-tiddler" $field="my-field" $value="my-value"/>'>
<$edit-text tag="input" tiddler="my-tiddler"/>
</$keyboard>
<$keyboard key="alt-shift-M" actions='<$action-setfield $tiddler="my-tiddler" $field="my-field" $value="my-value"/>'>
<$edit-text tag="input" tiddler="my-tiddler"/>
</$keyboard>
If actions are defined , the$keyboard
widget will invoke the actions defined in itsactions
attribute when it detects the key-combination defined in itskey
attribute being pressed in anyinput
ortextarea
field within its scope
Using global Keyboard Shortcuts
See Keyboard Shortcut Tiddler for detailed information about creating new global keyboard shortcuts.The actions for global keyboard shortcuts are stored in the text field of tiddlers tagged withThe key field connects an action-tiddler with the corresponding shortcut through the((my-shortcut))
syntax, called Keyboard Shortcut Descriptor
Syntax:
((
+a chosen suffix
+))
If the tiddler has the tag Keyboard Shortcut Descriptor as its value and some actions in its text field, the actions will be triggered when the mechanism detects the configured key-combination, the field key with the
\import [subfilter{$:/core/config/GlobalImportFilter}]
If the tiddler that contains the macro definition is known and - for example - titled my-macro-tiddler
\import my-macro-tiddler
Widgets
$action-navigate
(ActionNavigateWidget)
Messages
WidgetMessage: tm-cancel-tiddler
WidgetMessage: tm-close-all-tiddlers
WidgetMessage: tm-close-other-tiddlers
WidgetMessage: tm-close-tiddler
WidgetMessage: tm-delete-tiddler
WidgetMessage: tm-edit-tiddler
WidgetMessage: tm-import-tiddlers
WidgetMessage: tm-new-tiddler
WidgetMessage: tm-perform-import
WidgetMessage: tm-relink-tiddler
WidgetMessage: tm-rename-tiddler
WidgetMessage: tm-save-tiddler