var playTarget = {
        audio_page: 'ac_play',
        audio_modal: 'pd_play',
        audio_widget: 'gp_play',
        head_button: 'head_play_btn'
    },
    nextTarget = {
        audio_page: 'ac_next',
        audio_modal: 'pd_next'
    },
    prevTarget = {
        audio_page: 'ac_prev',
        audio_modal: 'pd_prev'
    };

function clickMany(targets) {
    for (var elementId in targets) {
        if (targets.hasOwnProperty(elementId))
            simulateClick(document.getElementById(targets[elementId]));
    }
}

function onKeyPress(key) {
    if (key == PREV) {
        clickMany(prevTarget);
    } else if (key == NEXT) {
        clickMany(nextTarget);
    } else if (key == PLAY) {
        clickMany(playTarget);
    }
}

function onKeyPress(key) {
    if (key === NEXT) {
        var nextButton = document.querySelector('button.top_audio_player_next');
        simulateClick(nextButton);
    } else if (key === PLAY) {
        var playPauseButton = document.querySelector('button.top_audio_player_play');
        simulateClick(playPauseButton);
    } else if (key === PREV) {
        var backButton = document.querySelector('button.top_audio_player_prev');
        simulateClick(backButton);
    }
}
Fix new VK.com