Results 1 to 4 of 4
  1. #1
    ramyal is offline Member
    Join Date
    Feb 2010
    Posts
    3
    Rep Power
    0

    Question Send Keystrokes from Java to Notepad

    I'm trying to develop a virtual keyboard to be used with text editors for spastic children. I use the Runtime class and exec method to spawn notepad. After spawning the process i need to send keystrokes to the notepad process. i.e., on click of a button in java frame, i need the corresponding char to be printed on the notepad. I tried using Robot in Java, but sends keystroke to window on top only.

    Can i send the keystrokes only to the process i want using Robot or any other method in JAVA?

    I tried to use frame.setvisible(false) and send the keystroke n then again making the frame visible... but the flicker is obvious and sometimes it doesn't send the keystroke to notepad.

    Instead of changing focus is there any other way to send the keystroke to notepad process?

    Awaiting your responses..

    Thanks
    Ramya

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

    Default

    Doesn't the Java Accessibility Framework help?

    kind regards,

    Jos

  3. #3
    ramyal is offline Member
    Join Date
    Feb 2010
    Posts
    3
    Rep Power
    0

    Default

    thanks jos bout that information... but i've developed my frame based GUI already and i'm new to theis javax accessebility classes n not sure how to use them. so my main concern to send the keystroke from my java app to the notepad process that i spawn!! how can it be done?

    Regards
    Ramya

  4. #4
    ramyal is offline Member
    Join Date
    Feb 2010
    Posts
    3
    Rep Power
    0

    Default

    I tried looking into Java Accessibility packages, but i need more time to learn them in detail... but i jus wanna know if there's any way to send the keystrokes only to the selected / particular process dynamically using Robot??

Similar Threads

  1. NotePad
    By whosadork in forum New To Java
    Replies: 10
    Last Post: 10-03-2008, 08:44 PM
  2. Notepad or IDE?
    By Eranga in forum Other IDEs
    Replies: 30
    Last Post: 09-22-2008, 05:20 AM
  3. Send keystrokes to iframe
    By nloding in forum New To Java
    Replies: 3
    Last Post: 08-29-2008, 06:06 PM
  4. Showing how to add Actions for KeyStrokes
    By Java Tip in forum javax.swing
    Replies: 0
    Last Post: 04-23-2008, 09:17 PM
  5. Creating a notepad application with java
    By Daniel in forum AWT / Swing
    Replies: 2
    Last Post: 07-02-2007, 06:18 PM

Tags for this Thread

Posting Permissions

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