From ce7becd64f68a7617dcb3183bf0aee0c036e8ac7 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Wed, 21 Nov 2018 12:24:50 +0100 Subject: [PATCH] KeyboardShortcut docs (#3496) * add SystemTag $:/tags/KeyboardShortcut * add Keyboard Shortcut Descriptor * Update KeyboardShortcuts.tid * Update KeyboardShortcutDescriptor.tid * Update and rename SystemTag_$__tags_KeyboardShortcut.tid to SystemTag_ $__tags_KeyboardShortcut.tid * Create KeyboardShortcutTiddler.tid * Update KeyboardShortcutTiddler.tid * Update KeyboardShortcutTiddler.tid * Update KeyboardShortcuts.tid * Update KeyboardShortcuts.tid --- .../concepts/KeyboardShortcutTiddler.tid | 12 +++++ .../KeyboardShortcutDescriptor.tid | 47 +++++++++++++++++++ .../tiddlers/howtos/KeyboardShortcuts.tid | 17 +++++-- .../SystemTag_ $__tags_KeyboardShortcut.tid | 7 +++ 4 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 editions/tw5.com/tiddlers/concepts/KeyboardShortcutTiddler.tid create mode 100644 editions/tw5.com/tiddlers/definitions/KeyboardShortcutDescriptor.tid create mode 100644 editions/tw5.com/tiddlers/systemtags/SystemTag_ $__tags_KeyboardShortcut.tid diff --git a/editions/tw5.com/tiddlers/concepts/KeyboardShortcutTiddler.tid b/editions/tw5.com/tiddlers/concepts/KeyboardShortcutTiddler.tid new file mode 100644 index 000000000..aca6b30a0 --- /dev/null +++ b/editions/tw5.com/tiddlers/concepts/KeyboardShortcutTiddler.tid @@ -0,0 +1,12 @@ +title: Keyboard Shortcut Tiddler +tags: Concepts + +A ''Keyboard Shortcut Tiddler'' is made of three parts: + +* The ''Tag'' <> +* The ''field'' `key` with a [[Keyboard Shortcut Descriptor]] as its ''value'' +* Actions in its ''text'' field + +If the [[Keyboard Shortcut Descriptor]] has the form `((my-shortcut))` it's a ''reference'' to a ''configuration Tiddler'' that stores the corresponding [[Keyboard Shortcut|KeyboardShortcuts]] + +In order to make a ''shortcut'' editable through the <<.controlpanel-tab KeyboardShortcuts>> Tab in the $:/ControlPanel it's sufficient to create a tiddler `$:/config/ShortcutInfo/my-shortcut`, where the ''suffix'' is the ''reference'' used for the [[Keyboard Shortcut|KeyboardShortcuts]] diff --git a/editions/tw5.com/tiddlers/definitions/KeyboardShortcutDescriptor.tid b/editions/tw5.com/tiddlers/definitions/KeyboardShortcutDescriptor.tid new file mode 100644 index 000000000..8a37e046b --- /dev/null +++ b/editions/tw5.com/tiddlers/definitions/KeyboardShortcutDescriptor.tid @@ -0,0 +1,47 @@ +title: Keyboard Shortcut Descriptor +tags: Definitions + +`Keyboard Shortcut Descriptors` are used by the [[KeyboardWidget]] and within Tiddlers tagged <> to link actions with a keyboard combination + +A `Keyboard Shortcut Descriptor` has the following format: + +``` + ctrl+enter + ctrl+shift+alt+A + alt-shift-T + alt-Space +``` + +It can have multiple Key combinations: + +``` +ctrl+enter alt+shift+A ctrl+alt+9 alt-Space ctrl-Backspace +``` + +There are ''two ways'' Keyboard Shortcut Descriptors can be used: + +* directly +** passing the attribute `key="ctrl-enter"` to the KeyboardWidget +** setting `ctrl-enter` as the ''value'' of the `key` ''field'' in a Tiddler tagged <> +* with a ''reference'' to a configuration Tiddler +** A ''configuration Tiddler'' for Keyboard Shortcuts follows some naming rules: +*** The title starts with `$:/config/` +*** Followed by either the string `shortcuts` or one of the following ''platform descriptors'': +**** <<.tid shortcuts-linux>> +**** <<.tid shortcuts-not-linux>> +**** <<.tid shortcuts-mac>> +**** <<.tid shortcuts-not-mac>> +**** <<.tid shortcuts-windows>> +**** <<.tid shortcuts-not-windows>> +*** The title ends with another `/` followed by a suffix that can be chosen freely +**** This suffix is the ''identifier'' for the `Keyboard Shortcut Descriptor` (A) +** The ''reference'' to the configuration Tiddler is made of `((` + the ''identifier'' (A) + `))` +*** Example: `((my-shortcut))` is the ''reference'' to these configuration Tiddlers: +**** <<.tid $:/config/shortcuts/my-shortcut>> +**** <<.tid $:/config/shortcuts-linux/my-shortcut>> +**** <<.tid $:/config/shortcuts-not-linux/my-shortcut>> +**** <<.tid $:/config/shortcuts-mac/my-shortcut>> +**** <<.tid $:/config/shortcuts-not-mac/my-shortcut>> +**** <<.tid $:/config/shortcuts-windows/my-shortcut>> +**** <<.tid $:/config/shortcuts-not-windows/my-shortcut>> +** Finally, the referenced configuration Tiddler stores the Keyboard Shortcut Descriptor in its ''text'' field diff --git a/editions/tw5.com/tiddlers/howtos/KeyboardShortcuts.tid b/editions/tw5.com/tiddlers/howtos/KeyboardShortcuts.tid index 6692f7e1e..ea07c63d9 100644 --- a/editions/tw5.com/tiddlers/howtos/KeyboardShortcuts.tid +++ b/editions/tw5.com/tiddlers/howtos/KeyboardShortcuts.tid @@ -4,13 +4,24 @@ tags: Features [[Working with TiddlyWiki]] title: KeyboardShortcuts type: text/vnd.tiddlywiki -Keyboard shortcuts are available for common editing operations: +Keyboard shortcuts can either be used with the <<.wlink KeyboardWidget>> Widget or with [[Keyboard Shortcut Tiddlers|Keyboard Shortcut Tiddler]] -* Confirming changes to the draft tiddler containing the keyboard focus (defaults to ctrl-Enter +<<.tip """The <$macrocall $name=".wlink" to="KeyboardWidget"/> Widget makes the shortcuts accessible within an `input` or `textarea` field + +A shortcut defined through a [[Keyboard Shortcut Tiddler]] makes the shortcut accessible globally""">> + +Keyboard shortcuts are available for common editing operations within the Text Editor: + +* Confirming changes to the draft tiddler containing the keyboard focus (defaults to ctrl-Enter) * Abandoning changes to the draft tiddler containing the keyboard focus (defaults to escape) * Formatting operations from the tiddler editing toolbar (see the tooltips) -The current shortcuts can be inspected and customised in the "Keyboard Shortcuts" tab of [[control panel|$:/ControlPanel]] {{$:/core/images/options-button}}. +<<.from-version 5.1.18>>: New ''global'' Keyboard shortcuts: + +* Creating a new tiddler (defaults to alt-N) +* Creating a new journal (defaults to alt-J) + +The current shortcuts can be inspected and customised in the "Keyboard Shortcuts" tab of the [[Control Panel|$:/ControlPanel]] {{$:/core/images/options-button}}. !! Special Keys diff --git a/editions/tw5.com/tiddlers/systemtags/SystemTag_ $__tags_KeyboardShortcut.tid b/editions/tw5.com/tiddlers/systemtags/SystemTag_ $__tags_KeyboardShortcut.tid new file mode 100644 index 000000000..20a5c156e --- /dev/null +++ b/editions/tw5.com/tiddlers/systemtags/SystemTag_ $__tags_KeyboardShortcut.tid @@ -0,0 +1,7 @@ +caption: $:/tags/KeyboardShortcut +description: uses the text of tagged tiddler as keyboard shortcut actions +tags: SystemTags +title: SystemTag: $:/tags/KeyboardShortcut +type: text/vnd.tiddlywiki + +The [[system tag|SystemTags]] `$:/tags/KeyboardShortcut` defines the tagged Tiddler as a [[Keyboard Shortcut Tiddler]], a ''container for actions'' that get triggered when its corresponding [[Keyboard Shortcut Descriptor]] in its `key` field matches a keyboard combination executed by the User