1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-18 16:25:13 +00:00

Extend keyboard handling

To cope with the Mac’s “meta” key (ie command/⌘) preparatory to
trapping command-S
This commit is contained in:
Jermolene
2014-09-02 10:41:48 +01:00
parent 44228ed9f7
commit b25351e834
2 changed files with 11 additions and 4 deletions

View File

@@ -41,10 +41,7 @@ KeyboardWidget.prototype.render = function(parent,nextSibling) {
domNode.className = classes.join(" ");
// Add a keyboard event handler
domNode.addEventListener("keydown",function (event) {
if(event.keyCode === self.keyInfo.keyCode &&
event.shiftKey === self.keyInfo.shiftKey &&
event.altKey === self.keyInfo.altKey &&
event.ctrlKey === self.keyInfo.ctrlKey) {
if($tw.utils.checkKeyDescriptor(event,self.keyInfo)) {
self.dispatchMessage(event);
event.preventDefault();
event.stopPropagation();