chrome-extension/js/background.js
function saveCommand(windowId, frame, cmd, data){
    if(isModuleLoading){
        return;
    }
    var cmdInfo = {
        window: windowId,
        frame: frame,
        cmd: cmd,
        data: data,
        fix: false
    };

    checkLostKey(windowId);

    switch(cmd){
        case 'keyDown':
            allKeyMap[data.character] = cmdInfo;
            break;
        case 'keyUp':
            delete allKeyMap[data.character];
            break;
        case 'mouseDown':
            allMouseMap[data.button] = cmdInfo;
            break;
        case 'mouseUp':
            delete allMouseMap[data.button];
            break;
    }

    execNextCommand(cmdInfo);
}
function saveCommand(windowId, frame, cmd, data){
    if(isModuleLoading){
        return;
    }
    var cmdInfo = {
        window: windowId,
        frame: frame,
        cmd: cmd,
        data: data,
        fix: false
    };

    checkLostKey(windowId);

    switch(cmd){
        case 'keyDown':
            allKeyMap[data.character] = cmdInfo;
            break;
        case 'keyUp':
            delete allKeyMap[data.character];
            break;
        case 'mouseDown':
            allMouseMap[data.button] = cmdInfo;
            break;
        case 'mouseUp':
            delete allMouseMap[data.button];
            break;
    }

    execNextCommand(cmdInfo);
}
function saveCommand ( windowId , frame , cmd , data ) { if ( isModuleLoading ) { return ; } var cmdInfo = { window : windowId , frame : frame , cmd : cmd , data : data , fix : false } ; checkLostKey ( windowId ) ; switch ( cmd ) { case 'keyDown' : allKeyMap [ data . character ] = cmdInfo ; break ; case 'keyUp' : delete allKeyMap [ data . character ] ; break ; case 'mouseDown' : allMouseMap [ data . button ] = cmdInfo ; break ; case 'mouseUp' : delete allMouseMap [ data . button ] ; break ; } execNextCommand ( cmdInfo ) ; }
save recoreded command
save recoreded command