473,325 Members | 2,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Keystroke buffer

is there ANYWAY to have a variable monitor keystrokes on an active page
with javascript and if x keys are pressed, show an alert? in other
words If I'm on the site and I type in "login", it alerts me saying
"You just typed login" with a kind of if (var == 'login') {
alert('alert') } etc, thanks guys.

Apr 21 '06 #1
1 2717

te******@gmail.com wrote:
is there ANYWAY to have a variable monitor keystrokes on an active page
with javascript and if x keys are pressed, show an alert? in other
words If I'm on the site and I type in "login", it alerts me saying
"You just typed login" with a kind of if (var == 'login') {
alert('alert') } etc, thanks guys.


Yeah I think the start of what you need is something like

typed = "";

document.onkeypress=monitorFunc;

function monitorFunc(e) {
keyCode = (e)? e.keyCode : window.event.keyCode;
char = String.fromCharCode(keyCode).toLowerCase();
typed += char;
}

You should implement backspace and clear the typed variable when enter
is pressed, keyCode for backspace is 8, return is 13.

Apr 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ste | last post by:
Hello, my goal would be implementing some keystroke analysis using php. I'm a novice in php, so i ask your advice: according to you, is it possible to log each keystroke client-side even if php is...
7
by: hokieghal99 | last post by:
Does anyone know of a keystroke logger that has been written in Python for Windows machines? I'd like to see such a script and use it as a point of reference for a real-time backup project that I'm...
2
by: Wayne Wengert | last post by:
I want to get the decimal (integer) value of user keystrokes. I am using the following code. chrInput is the character entered (e.g. "M") and "keystroke is DIMed as Short keystroke =...
1
by: Amin Gunawan via .NET 247 | last post by:
I would like to put a combo box in a column of a datagrid. I've seen the samples in the MSDN library of other sources, butall samples didn't catch the 'DOWN/UP' keystroke. It means thatwhen I select...
15
by: Frank Bormann | last post by:
Hi, probably a stupid question, but I haven't been able to find anything. Is there a istream related function that let me read exactly one keystroke from the keyboard through cin? What I...
6
by: ez2cwhy | last post by:
I'm relatively new to using javascript, so I'm not sure if this is a known problem, or something that I'm doing wrong. (99.9% sure it's something I'm doing wrong.) Here's the situation: I have...
2
by: John | last post by:
We have an interesting programming problem and I wonder if anyone would know how to accomplish this, or be able to point me in the right direction I have a list of 100 items, in this case it's...
3
Claus Mygind
by: Claus Mygind | last post by:
with the "onKeyPress" event handler I see that I can capture and examine the value of a keystroke before it is displayed on the screen. I have made good use of this for single character fields where...
1
by: visweswaran2830 | last post by:
Hi, I need to stop the keystroke event when I pressed a particular key. For Eg: If press alt+tab key then that keys should not perform that operation, that should operation should be...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.