Results 1 to 13 of 13
  1. #1
    m-i-l-s-o-n is offline Member
    Join Date
    Sep 2010
    Posts
    24
    Rep Power
    0

    Default How can I build a KeyBoard Simulator?

    I wanna tell OS that for example Right Key is released anyone can help me?

  2. #2
    XmisterIS is offline Member
    Join Date
    Aug 2010
    Posts
    35
    Rep Power
    0

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default

    Quote Originally Posted by m-i-l-s-o-n View Post
    I wanna tell OS that for example Right Key is released anyone can help me?
    The OS tells you stuff, you don't tell the OS anything. Perhaps you would like to provide more detail on the problem situation.

    db

  4. #4
    m-i-l-s-o-n is offline Member
    Join Date
    Sep 2010
    Posts
    24
    Rep Power
    0

    Default

    more details :
    my program have a button
    i wanna when user press button my program tell OS that right Key is Down
    and when user released it my program tell OS that right Key is UP
    (my problem is not key listening)
    anyone can help me?

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,776
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by m-i-l-s-o-n View Post
    more details :
    my program have a button
    i wanna when user press button my program tell OS that right Key is Down
    and when user released it my program tell OS that right Key is UP
    (my problem is not key listening)
    anyone can help me?
    Maybe the Robot class can help (a bit).

    kind regards,

    Jos

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default

    Quote Originally Posted by m-i-l-s-o-n View Post
    more details :
    my program have a button
    i wanna when user press button my program tell OS that right Key is Down
    and when user released it my program tell OS that right Key is UP
    I already told you
    The OS tells you stuff, you don't tell the OS anything.
    The detail of your program "having" a button is essentially useless.

    What are you actually trying to achieve? (NOT how you think it can be achieved)

    db

  7. #7
    collin389 is offline Senior Member
    Join Date
    Nov 2009
    Posts
    235
    Rep Power
    6

    Default

    well i'm guessing he wants to build a keyboard simulator (just a guess but look at the thread name). Which would involve the program not being able to have focus, always on top, and able to send keystrokes to the OS (I'm guessing you would have to use some private libraries to access the win32 lib and make a low level keyboard hook (which would only work for windows)... or something

  8. #8
    m-i-l-s-o-n is offline Member
    Join Date
    Sep 2010
    Posts
    24
    Rep Power
    0

    Default

    Collin389 thats correct
    U said my mean
    Can u help me what i should do exactly?

  9. #9
    m-i-l-s-o-n is offline Member
    Join Date
    Sep 2010
    Posts
    24
    Rep Power
    0

    Default

    NoOne cant help me?:(

  10. #10
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,776
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by m-i-l-s-o-n View Post
    NoOne cant help me?:(
    You have to 'fool' the OS making it think that your program is the keyboard driver but that is far 'below' the capabilities of Java, i.e. you have to use quite a bit of JNI code (native code) to do that. Take it from me: you don't want to go there, it is far from a trivial task (if at all possible using 'simple' Java and a bit of native code). Collin (and others) already told you that.

    kind regards,

    Jos

  11. #11
    m-i-l-s-o-n is offline Member
    Join Date
    Sep 2010
    Posts
    24
    Rep Power
    0

    Default

    dear jos
    fortunatly Robot class solved my problem
    thanx a lot!

  12. #12
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,776
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by m-i-l-s-o-n View Post
    dear jos
    fortunatly Robot class solved my problem
    thanx a lot!
    Good; take care of the focus because you don't want the component(s) that (indirectly) caused the key event to receive that same event.

    kind regards,

    Jos

  13. #13
    m-i-l-s-o-n is offline Member
    Join Date
    Sep 2010
    Posts
    24
    Rep Power
    0

Similar Threads

  1. Java Network simulator.
    By priya deshpande in forum Networking
    Replies: 4
    Last Post: 02-18-2012, 04:55 PM
  2. Building a HSM Simulator
    By stunnaz101 in forum Advanced Java
    Replies: 0
    Last Post: 03-23-2010, 11:01 AM
  3. simulator program with RS232
    By john wooo in forum Networking
    Replies: 7
    Last Post: 02-11-2009, 03:26 PM
  4. KeyBoard Problem
    By arimakidd in forum Java Applets
    Replies: 3
    Last Post: 09-19-2008, 05:05 PM
  5. Traffic simulator
    By dirtycash in forum New To Java
    Replies: 1
    Last Post: 03-12-2008, 04:59 AM

Posting Permissions

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