1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-02 06:19:57 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/concepts/KeyboardShortcutTiddler.tid
Maurycy Zarzycki f33c7e2aef
Allow global keyboard shortcuts to override all other shortcuts by providing a special field (#6735)
* allow global keyboard shortcuts to override all other shortcuts by providing a special field

* rework the global shortcuts taking priority

* replace bool option with options object in KeyboardManager's keydown handler

* update keyboard shortcut documentation to add information about the new priority setting

* add support for priority global keyboard shortcuts to code mirror

* update the feature's docs to point out it was/will be introduced in 5.2.4

* rollback unnecessary change
2022-10-07 17:31:04 +01:00

22 lines
1.4 KiB
Plaintext

title: Keyboard Shortcut Tiddler
tags: Concepts
A ''Keyboard Shortcut Tiddler'' is made of three parts:
* The ''Tag'' <<tag-pill $:/tags/KeyboardShortcut>>
* The ''field'' `key` with a [[Keyboard Shortcut Descriptor]] as its ''value''
* Actions in its ''text'' field
<<.tip """<<.from-version "5.2.4">> By default <<.wlink KeyboardWidget>> and text editor shortcuts take priority, which can be circumvented by setting the ''field'' `priority` to `yes`.""">>
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]]
!! Notes on wiki navigation
If you want to create keyboard shortcuts for navigation, there are two things to keep in mind:
* If your shortcut uses ''Ctrl'', you need to include `$scroll="yes"` in the [[ActionNavigateWidget's|ActionNavigateWidget]] attributes otherwise the action will be ignored.
* The actions need to be wrapped in [[NavigatorWidget]] like in this [[New Tiddler keyboard shortcut|$:/core/ui/KeyboardShortcuts/new-tiddler]].