项目最近要用现在最新的Ext做前台,要搞一个快捷键。以下是非常简单的代码。fn后的function就是你用了快捷键之后做的动作。
?
var map = new Ext.util.KeyMap(this.document, {
??????????????? key: 'a',
??????????????? alt: true,
??????????????? shift:true,
??????????????? ctrl:true,
??????????????? fn: function(e){
??????????????????? alert("a+shift+ctrl");
??????????????? },
??????????????? scope: this,
??????????? });