if (editor) {
editor.enableKeyEvents = true;
editor.on("keydown", function(f, e) {
var keyCode = e.getKey();
if (e.ctrlKey == true) {
// ctrl+c ctrl+v 等系统快捷键不屏蔽
// 86, 90, 88, 67, 65
if (keyCode == 86 || keyCode == 90 || keyCode == 88 || keyCode == 67 || keyCode == 65) {
return true;
}
}
if (e.ctrlKey || e.altKey || (keyCode >= 112 && keyCode <= 123)) {
e.preventDefault();// editor需要额外处理全键盘事件
}
}, this)
}
来源:CSDN
作者:Harry May
链接:https://blog.csdn.net/m0_37558768/article/details/103970975