Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Closed Thread
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-07-2005, 12:40 AM   PM User | #1
dwj100uni
New to the CF scene

 
Join Date: Oct 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
dwj100uni is an unknown quantity at this point
[JAVA] Key Logger Help

Hi everyone.

I have read all of the Homework posts and have also done a search on the whole forum and still have not been able to find any information that helps me with my problem; I was hoping that someone may be able to help.

I have spoken to my lecturer and carried out alot of research but connot find the information that I need.

Basically, I need to know how that Java could be used to record the keystrokes of a user and then store them into an external file. Or even whether or not that Java CAN actually do this?? More importantly the software needs to work when it is not the active program running on the PC (i.e. it is not the active window), and it needs to install discreetly on the users computer.

If anyone can help me I'd be extremely grateful, as I am truly stuck.

Thanks very much,

David

Last edited by dwj100uni; 10-07-2005 at 12:45 AM..
dwj100uni is offline  
Old 10-07-2005, 01:24 AM   PM User | #2
KeZZeR
Regular Coder

 
Join Date: Oct 2004
Location: England
Posts: 282
Thanks: 0
Thanked 0 Times in 0 Posts
KeZZeR is an unknown quantity at this point
That sounds dodgy. A key logging application that needs to install discretely and is a hidden application?

Yes you can log key events with Java, but if the window is out of focus then i'm not sure if you can. KeyEvent I think is the standard keystroke event class but i've never used it personally.
KeZZeR is offline  
Old 10-07-2005, 04:09 PM   PM User | #3
punx
New Coder

 
Join Date: Aug 2005
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
punx is an unknown quantity at this point
While on the subject of key logger... What do you need to import to instantiate a newy KeyStroke object? Heres the code I have:
Code:
import java.awt.AWTKeyStroke;
import javax.swing.KeyStroke;
...
KeyStroke k = new KeyStroke();
...
System.out.println("Type something: ");
key = k.getKeyStroke();
System.out.println("The key you pressed was: "+key+".\n");
...
When I compile the program I get.
Quote:
--------------------Configuration: <Default>--------------------
C:\Documents and Settings\admin\Desktop\KeyLogger.java:19: cannot resolve symbol
symbol : constructor KeyStroke ()
location: class javax.swing.KeyStroke
KeyStroke k = new KeyStroke();
^
C:\Documents and Settings\admin\Desktop\KeyLogger.java:26: cannot resolve symbol
symbol : method getKeyStroke ()
location: class javax.swing.KeyStroke
key = k.getKeyStroke();
Any tips? Thanks.
punx is offline  
Old 10-07-2005, 05:00 PM   PM User | #4
Antoniohawk
Senior Coder

 
Join Date: Aug 2002
Location: Kansas City, Kansas
Posts: 1,518
Thanks: 0
Thanked 2 Times in 2 Posts
Antoniohawk will become famous soon enough
Even though your intentions may be genuine, there's no way of knowing. Gotta shut you down.
Antoniohawk is offline  
Closed Thread

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:38 AM.


Advertisement
Log in to turn off these ads.