捕获字典
启动
按键捕获
按键状态
状态字典
发射事件。
返回发射后的事件。
事件的类型。类型区分大小写。
Optional data: any事件携带的自定义数据。
是否向上级报告事件。默认为false。
是否向下级广播事件。默认为false。
是否向平级分享事件。默认为true。
Private get获取快捷键唯一字符串
Optional command?: stringOptional stateOptional when?: stringProtected handelProtected handelProtected handel向平级分享事件
事件
Protected handleStatic get获取事件发射器
Static get获取事件发射器,当没有找到对应发射器时,返回新建的事件发射器。
Generated using TypeDoc
初始化快捷键模块
var shortcuts:Array = [ // //在按下key1时触发命令command1 {key: "key1", command: "command1", when: ""}, // //在按下key1时触发状态命令改变stateCommand1为激活状态 {key: "key1", stateCommand: "stateCommand1", when: "state1"}, // //处于state1状态时按下key1触发命令command1 {key: "key1", command: "command1", when: "state1"}, // //处于state1状态不处于state2时按下key1与没按下key2触发command1与command2,改变stateCommand1为激活状态,stateCommand2为非激活状态 {key: "key1+ ! key2", command: "command1,command2", stateCommand: "stateCommand1,!stateCommand2", when: "state1+!state2"}, // ]; //添加快捷键 shortCut.addShortCuts(shortcuts); //监听命令 Event.on(shortCut,"run" as any, function(e:Event):void { trace("接受到命令:" + e.type); });