Jquery Ctrl + Click

Detectar evento de click + tecla de control ao mesmo tempo.

by Salustiano Silva

HTML

<select size="4" multiple>
    <option>1</option>
    <option>2</option>
    <option>3</option>
</select>
<p></p>

JavaScript

$('select').click(function(e) {
    if (e.ctrlKey) {
        //Ctrl+Click fazer algo

        var html = '';
        $('select :selected').each(function() {
            html = html + ' ' + $(this).val();
        });
        $('p').html("<strong>Selecção: </strong>" + html);
    } else {
        $('p').html("Não, tenta de novo!");
    }
});