1

I am trying to use javascript to record every key that is pressed even when the window isn't focused.

Example: I am typing up a work document but I still want JavaScript to record the keys that I press.

Is this even possible to do with JavaScript? If not, could I do it with PHP, Ruby, Python, or any other web based programing language?

Thank you so much for your help.

Progo
  • 3,452
  • 5
  • 27
  • 44

1 Answers1

1

Not in the browser, for sure. That would be a blatant violation of security. Imagine if you were in a website, and they were recording your keystrokes. You typed in gmail.com, so they know you're at gmail, and then you typed in your username and password. They would have access to your entire email. The same goes true for anything else, such as bank accounts. As for server side languages, they can't record anything in the client side unless it is sent to them by the client. You can, however, do this on the desktop, with languages like C#, Objective C, or Java.

scrblnrd3
  • 7,228
  • 9
  • 33
  • 64
  • Ok, thanks. The reason I was asking about web based programming is because that is all I know how to do. I am learning Java though. Do you know if you could make a program that could do that? – Progo Dec 04 '13 at 03:06
  • @Progo I myself couldn't, but you could learn more about that at http://stackoverflow.com/questions/12177416/java-key-listener-to-track-all-keystrokes . Note, however, that it would be much easier to do this in a native language, such as VB or C# – scrblnrd3 Dec 04 '13 at 03:08
  • I would love to learn but I don't know of a good, free, resource for learning them. Do you? – Progo Dec 04 '13 at 03:14
  • I've found the MSDN gives good tutorials http://msdn.microsoft.com/en-us/library/aa288436(v=vs.71).aspx – scrblnrd3 Dec 04 '13 at 03:15
  • Cool! How did you find it? I have been all over the web looking for tutorials. – Progo Dec 04 '13 at 03:17
  • Is there one for Java? I kind of want to learn java more than C#. – Progo Dec 04 '13 at 03:32
  • I have used the oracle. I like it, but is isn't the most interesting way to learn. If I can't find anything else, I will use it though. Thanks so much! – Progo Dec 04 '13 at 04:06