Add alt key hook to keyboard event handler (just in case :-)

This commit is contained in:
Dave C-J 2014-05-14 14:17:26 +01:00
parent 0e35b65afd
commit a76f48f50b
1 changed files with 10 additions and 8 deletions

View File

@ -23,8 +23,9 @@ RED.keyboard = function() {
var handler = handlers[d3.event.keyCode]; var handler = handlers[d3.event.keyCode];
if (handler && handler.ondown) { if (handler && handler.ondown) {
if (!handler.modifiers || if (!handler.modifiers ||
((!handler.modifiers.shift || d3.event.shiftKey)&& ((!handler.modifiers.shift || d3.event.shiftKey) &&
(!handler.modifiers.ctrl || d3.event.ctrlKey))) { (!handler.modifiers.ctrl || d3.event.ctrlKey ) &&
(!handler.modifiers.alt || d3.event.altKey ) )) {
handler.ondown(); handler.ondown();
} }
} }
@ -34,8 +35,9 @@ RED.keyboard = function() {
var handler = handlers[d3.event.keyCode]; var handler = handlers[d3.event.keyCode];
if (handler && handler.onup) { if (handler && handler.onup) {
if (!handler.modifiers || if (!handler.modifiers ||
((!handler.modifiers.shift || d3.event.shiftKey)&& ((!handler.modifiers.shift || d3.event.shiftKey) &&
(!handler.modifiers.ctrl || d3.event.ctrlKey))) { (!handler.modifiers.ctrl || d3.event.ctrlKey ) &&
(!handler.modifiers.alt || d3.event.altKey ) )) {
handler.onup(); handler.onup();
} }
} }