extjs给控件添加键盘事件
作者:互联网
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)
}
Harry May
发布了9 篇原创文章 · 获赞 0 · 访问量 200
私信
关注
标签:控件,ctrl,keyCode,键盘,88,editor,ctrlKey,true,extjs 来源: https://blog.csdn.net/m0_37558768/article/details/103970975