Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Oct 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    [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 01:45 AM.

  • #2
    Regular Coder
    Join Date
    Oct 2004
    Location
    England
    Posts
    282
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #3
    New Coder
    Join Date
    Aug 2005
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    --------------------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.

  • #4
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Even though your intentions may be genuine, there's no way of knowing. Gotta shut you down.


  •  

    LinkBacks (?)


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •