(e)
| 528 | return true; |
| 529 | } |
| 530 | function handleKeyBinding(e) { |
| 531 | // Handle auto keymap transitions |
| 532 | var startMap = getKeyMap(options.keyMap), next = startMap.auto; |
| 533 | clearTimeout(maybeTransition); |
| 534 | if (next && !isModifierKey(e)) maybeTransition = setTimeout(function() { |
| 535 | if (getKeyMap(options.keyMap) == startMap) { |
| 536 | options.keyMap = (next.call ? next.call(null, instance) : next); |
| 537 | } |
| 538 | }, 50); |
| 539 | |
| 540 | var name = keyNames[e_prop(e, "keyCode")], handled = false; |
| 541 | if (name == null || e.altGraphKey) return false; |
| 542 | if (e_prop(e, "altKey")) name = "Alt-" + name; |
| 543 | if (e_prop(e, "ctrlKey")) name = "Ctrl-" + name; |
| 544 | if (e_prop(e, "metaKey")) name = "Cmd-" + name; |
| 545 | |
| 546 | var stopped = false; |
| 547 | function stop() { stopped = true; } |
| 548 | |
| 549 | if (e_prop(e, "shiftKey")) { |
| 550 | handled = lookupKey("Shift-" + name, options.extraKeys, options.keyMap, |
| 551 | function(b) {return doHandleBinding(b, true);}, stop) |
| 552 | || lookupKey(name, options.extraKeys, options.keyMap, function(b) { |
| 553 | if (typeof b == "string" && /^go[A-Z]/.test(b)) return doHandleBinding(b); |
| 554 | }, stop); |
| 555 | } else { |
| 556 | handled = lookupKey(name, options.extraKeys, options.keyMap, doHandleBinding, stop); |
| 557 | } |
| 558 | if (stopped) handled = false; |
| 559 | if (handled) { |
| 560 | e_preventDefault(e); |
| 561 | restartBlink(); |
| 562 | if (ie) { e.oldKeyCode = e.keyCode; e.keyCode = 0; } |
| 563 | } |
| 564 | return handled; |
| 565 | } |
| 566 | function handleCharBinding(e, ch) { |
| 567 | var handled = lookupKey("'" + ch + "'", options.extraKeys, |
| 568 | options.keyMap, function(b) { return doHandleBinding(b, true); }); |
no test coverage detected