Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2009
    Posts
    2
    Rep Power
    0

    Default In java,how to detect Plug & Unplug USB key for both linux and Windows OS

    Hi Friends,

    This is Santhosh.I am new for this forum also Java.I want to know,In java,how to detect Plug & Unplug USB key for both linux and Windows OS.Please let me know if u guys knows.

  2. #2
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    Pretty sure that you can't. Would have to write native code to hook into the OS and connect via JNI.
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  3. #3
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    I think what O.D. is saying is that Java doesn't deal with keyboards; that is the job of the OS. If the keyboard works with the OS, then keystrokes will be sent, by the OS, to the Java program.

  4. #4
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    Nothing to do with keyboards. This is about the interrupt the OS gets when you (un)plug something in a USB port.
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  5. #5
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    7

    Default

    i'm doubting that it can be done as well. i think that the best you can do is check if a drive exists or not.

Similar Threads

  1. Replies: 6
    Last Post: 04-08-2009, 05:05 AM
  2. Java On Linux
    By Natrix in forum New To Java
    Replies: 15
    Last Post: 04-08-2009, 01:31 AM
  3. Character encoding in Java (Linux to Windows)
    By BeholdMyGlory in forum New To Java
    Replies: 2
    Last Post: 01-16-2009, 07:24 PM
  4. Java Plug-In 2SSV Helper
    By rbli in forum New To Java
    Replies: 0
    Last Post: 11-03-2008, 03:15 PM
  5. Access Linux shared folder from Windows OS
    By nitinpjairaj in forum Networking
    Replies: 3
    Last Post: 08-26-2008, 07:14 PM

Posting Permissions

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