I've been trying to get jQuery to detect a number of letters entered after each other on a keyboard.
Actually, all I wanted to achieve is, to use the .keypress function to detect a word instead of a single character. Now, I can't type a word and press all keys at the same time, so I have to program a way where jQuery remembers the letters I've typed in before, so if I write "test", it will remember "t,e and s" before I type in the last "t" which will then make a if condition come true.
Here's what I tried, but I don't know how to store characters (basically like a keylogger, but simply for a single word, which will be used to open an application):
$(document).keypress(function(e) {
if( e.ctrlKey && ( e.which === 46 ) ) {
alert('Ctrl and DEL pressed!');
}
});
This way, I managed to get jQuery recognize a key combination, but that's all I know for now.
Can anyone help me to figure out how to detect a whole world?
Thank you so much.