作者的話:
tell application "wechatwebdevtools"activatedelay 0.2tell application "System Events"key code {55, 15}end tellend tell
function registShortcut(key, onactive) {
var option = {key : key,active : onactive,failed : function(msg) {// :(, fail to register the |key| or couldn't parse the |key|.console.log(msg);}};
// Create a shortcut with |option|.var shortcut = new nw.Shortcut(option);
// Register global desktop shortcut, which can work without focus.nw.App.registerGlobalHotKey(shortcut);}
registShortcut("Command+Shift+R", function () {e.reload()})registShortcut("Command+Shift+B", function () {e.reBuild()})
autocmd BufWritePost *.wxml call macos#keycodes('command', 'shift', 'r')autocmd BufWritePost *.wxss call macos#keycodes('command', 'shift', 'r')