1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 10:29:54 +00:00

Let $keyboard trigger action-widgets

Because of the refresh problems with the other widgets triggering action-widgets I am doing this one by itself. I hadn't included it before.

This shouldn't have any more problems than the button widget does, and any problems caused by it should be fixed by any fix we use for the button widget. See #1564 for more background
This commit is contained in:
jed 2015-10-26 20:23:09 +01:00
parent 106f11343e
commit e55c5b0669

View File

@ -42,6 +42,10 @@ KeyboardWidget.prototype.render = function(parent,nextSibling) {
// Add a keyboard event handler
domNode.addEventListener("keydown",function (event) {
if($tw.utils.checkKeyDescriptor(event,self.keyInfo)) {
var handled = false;
if(self.invokeActions(this,event)) {
handled = true;
}
self.dispatchMessage(event);
event.preventDefault();
event.stopPropagation();