(cm, e)
| 3972 | |
| 3973 | // Handle a key from the keydown event. |
| 3974 | function handleKeyBinding(cm, e) { |
| 3975 | var name = keyName(e, true); |
| 3976 | if (!name) return false; |
| 3977 | |
| 3978 | if (e.shiftKey && !cm.state.keySeq) { |
| 3979 | // First try to resolve full name (including 'Shift-'). Failing |
| 3980 | // that, see if there is a cursor-motion command (starting with |
| 3981 | // 'go') bound to the keyname without 'Shift-'. |
| 3982 | return dispatchKey(cm, "Shift-" + name, e, function(b) {return doHandleBinding(cm, b, true);}) |
| 3983 | || dispatchKey(cm, name, e, function(b) { |
| 3984 | if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) |
| 3985 | return doHandleBinding(cm, b); |
| 3986 | }); |
| 3987 | } else { |
| 3988 | return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); }); |
| 3989 | } |
| 3990 | } |
| 3991 | |
| 3992 | // Handle a key from the keypress event |
| 3993 | function handleCharBinding(cm, e, ch) { |
no test coverage detected