29-06-2012, 07:07 PM
var needle = 'ta phrase';
var haystack = '';
window.addEventListener('keypress', function(e) {
haystack += String.fromCharCode(e.charCode);
if (haystack.indexOf(needle) > -1) {
alert('bonne combinaison');
haystack = '';
}
}, false);