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
This commit is contained in:
Maurycy Zarzycki
2022-10-07 18:31:04 +02:00
committed by GitHub
parent fc586481a9
commit f33c7e2aef
6 changed files with 37 additions and 2 deletions

View File

@@ -186,6 +186,10 @@ function CodeMirrorEngine(options) {
return false;
});
this.cm.on("keydown",function(cm,event) {
if ($tw.keyboardManager.handleKeydownEvent(event, {onlyPriority: true})) {
return true;
}
return self.widget.handleKeydownEvent.call(self.widget,event);
});
this.cm.on("focus",function(cm,event) {