Sending keystrokes with keys held down

Hello,
I am trying to develop a program which will allow me to send keystrokes to another application (possibly not Java) based on a programmatically produced script. Similar to a macro program.
Ideally, I would like to be able to send keystroke combinations including periods where 1 or more keys are held down (other than normal control keys such as SHIFT and ALT). For example, I would like to be able to send keystrokes to another program to mimic this script:
KEY "a": hold down for 10 seconds, do nothing for 5 seconds, tap once.
KEY "b": do nothing for 12 seconds, tap, wait one second, tap, tap.
KEY "c": hold down for 5 seconds, pause 10, hold down for 5 seconds
Key "d": pause 5 seconds, hold down for 10 seconds, pause for 5
etc
...where each key's script is run simultaneously, ie, the 3rd second of the script will see key "a" being held down, and key "c" held down. The 12th second will see the "b" key tapped once while the "d" key was held down.
My intention is to use such a program to drive others which use the keyboard for input, but not as typed keys, but rather as buttons.
Does anyone have any ideas on how this could be done?

I'm not sure, but could the Robot class work for you?
http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Robot.html

Similar Messages

  • How do I resolve this error message? The iPhoto library is on a locked volume.  Reopen iPhoto when you have read/write access, or reopen iPhoto with the Option key held down to choose another library.

    How do I resolve this error message? The iPhoto library is on a locked volume.  Reopen iPhoto when you have read/write access, or reopen iPhoto with the Option key held down to choose another library.

    Hi j,
    I don't know if this will work, but I'd try logging in to an admin account, going to your main library (not user library), opening it, opening Application Support, selecting iPhoto, hold down the command key and press i, click on the lock in the lower left, entering the password and making sure you have Read & Write privileges for System and Admin.

  • I have lost my Safari app and all the bookmarks that go with it. I have tried to download my back-up on external drive but cannot access it. Tried a start with C key held down but still no access to the back-up app.

    I have lost my Safari app and all the bookmarks that go with it. I have tried to download my back-up on external drive but cannot access it. Tried a start with C key held down but still no access to the back up app.
    Have used Superduper app. to back up and checked back-up occasionally to see if all files present  and appeared OK.
    I had previously started machine using original CD #1 to try and replace Eudora which was acting up. Did not knowingly touch Safari.
    Running iMAC System 10.4.11
    How can I successfully download from the Maxtor back-up?
    Ivan

    Further info.
    I checked the content of my other back-up and found the bookmark Bookmarks.plist in the library under Safari
    Dumped the existing copy in the computer and drag-dropped the back up. All bookmarks restored.
    Solved the Stickies problem by using Spotlight  to find file "stickiesdatabase" and did a drag- drop to replace file. All data restored.
    Re Ical data loss. Used Spotlight to find iCal document in  Library - Preferences where I found com.apple.iCal.plist in folder.
    Got ready to make change but did not immediately remove file. When I returned to Preferences folder to grab above document,
    the readable descriptors had been changed to code consisting of some upper case letters and/or single symbols!
    So now I cannot tell which is the symbol  iCal.plist
    Thanks for leading me so far, but how do I find that plist for my calendar?

  • The iPhoto library is a Time Machine backup, and so cannot be used as the main library. Reopen iPhoto with the Option key held down to choose another library.

    I recently tried to look up my pictures on my time machine back up on an external hard drive. As soon as I try to open it I get the following message.
    "The iPhoto library is a Time Machine backup, and so cannot be used as the main library. Reopen iPhoto with the Option key held down to choose another library."
    I have tried holding down the option key but still couldn't few the photos.
    I want to know if there is anyway I can actually view these photos. I have over 85gbs of photos on the hard drive.  I have tried googling and looking at pervious forums with the same problem but nothing is working.
    Please help!

    Select Mac Help from the Finder's Help menu. Search for "Restore items backed up with Time Machine."

  • When starting up my iMac with Option Key held down, my recovery partition shows 10.9 instead of 10.10.  How do I install the correct recovery partition?

    iMac (27-inch, Mid 2011)
    Yosemite 10.10.1
    When I start up my iMac with option key held down, the recovery partition is shown as 10.9 instead of 10.10 which is the installed version.
    How do I install the proper recovery partition?

    Thanks very much for the quick reply.  I figured it would something that simple.  Like I said, I only know enough to cause trouble.  LOL
    Thanks again,  Guess I need to find a new game to play.  LOL

  • This message shows up when I try to access my auxiliary iPhone library: "The iPhoto library is on a locked volume. Reopen iPhoto when you have read/write access, or reopen iPhoto with the Option key held down to choose another library."

    This message shows up when I try to access my auxiliary iPhone library: "The iPhoto library is on a locked volume. Reopen iPhoto when you have read/write access, or reopen iPhoto with the Option key held down to choose another library."
    What did I do wrong?  I have been downloading all my photos into this same library since Janurary with no problems.

    What version of Mac OS X?
    Click the black Apple icon on the top left of the screen and select About This Mac. The next screen will show the information.

  • After silverlight update laptop acts as if shift key held down

    After silverlight update laptop acts as if shift key held down, i.e. all caps, no numbers, it means I can't input passwords or open folders or select single items. Called Apple Help and they walked me through reinstlling OS from disk and it helped for about 12 hours. Now it shuffles between this ALLCAPS version and regular mode and won't allow me to reinstall anything. Any ideas? Thanks!

    lynnefromoakland wrote:
    HI tjk,
    Thanks for replying! I didn't do anything else during the 12 hours of normal use--the Silverlight update followed one of those automated updates that caused Netflix streaming to stop working. I haven't re-callled Apple Support because when I initially described the problem to the tech, he said to do the reinstall and if that didn't work I should bring the laptop in to one of the stores and see what they could do there. If the problem continues, will have to do that this weekend, I guess. . .
    Lynne
    Ok, that like means the AppleCare representative thinks there may be a hardware issue. One other thing you can try is an SMC Reset: http://support.apple.com/kb/HT3964

  • How to capture keys held down during app load

    how would i capture which keys are being held down during the start of a java application? IE: enduser clicks on my java app while pressing SHIFT+C+F so i can load a config window to set a couple of needed options specific to that environment?
    Thanks

    I don't believe there is any functionality in Java to achieve that.
    If it is a command line app., I recommend handing arguments to main() to pop the config. dialog.
    If it is a GUI'd app., add a button to the main UI, that does the same.

  • No screen displayed when booting with options key held down

    When I hold the option key down to select which OS I want to boot into I am getting nothing displayed on the screen but the booting has paused waiting for my input because I can use the cursor keys and return to get the system to boot.
    Anyone got any ideas as to why I cant see the choices?
    Thanks
    Gary

    Just a quick follow up on this problem. I have just tried the Mac Mini on my TV using the HDMI port and I get the boot menu displayed when holding down the Option Key and it works fine. The issues are arising when I plug a VGA adaptor into the mini display port and use that with my monitor. The monitor is not reporting any out of range or sync signals while booting and I have tried 3 different monitors of various ages and all have the same result.
    I also get no apple logo or any display while OSX is loading when I use the monitor
    Gary

  • Crashes on launch, even with option key held down

    It crashes immediately whenever I launch. This happens even if I hold down the option key. I have version 23.0.1, which I believe is current.
    bp-98bc09af-ceea-4295-b10d-b2fe82130914

    Can you create a new profile?
    See "Creating a profile":
    *https://support.mozilla.org/kb/profile-manager-create-and-remove-firefox-profiles
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Profile_issues
    If the new profile works then you can transfer some files from an existing profile to the new profile, but be cautious not to copy corrupted files to avoid carrying over the problem.
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • Splash screen loads, then FF crashes, even with Shift key held down. HELP!

    For some weeks now I have been having problems with both Firefox and Thunderbird. Neither will load. Sometimes I have been able to load once after a clean reinstall. I have tried:
    virus scanning and cleaning
    portable version on different computers (I use a portable version whenever possible but this has become an issue on static computers also)
    deletion of data folder
    Just to rub salt in the wound, when the programs crash and I try to send a report, the error reporter says it is unable to send a report. Have not had time/patience to look into that.

    Firefox Portable has a splash screen. I don't think FirefoxPortable will launch into SafeMode, or it just doesn't work for me.
    If you are using FirefoxPortable ''[which isn't made by Mozilla, it's a 3rd party application]'', you might want to ask for help from the appropriate forum. Maybe they have a trick for launching in the SafeMode that I am unaware of.
    http://portableapps.com/forums/support/firefox_portable

  • IPhoto won't open.  Says CAUTIONThe iPhoto library is a Time Machine backup, and so cannot be used as the main library. Reopen iPhoto with the Option key held down to choose another library.

    I tries to verify that my photos were being backed up on Time Machine to an external harddrive, because I would like to delete my Camera Roll on my iPhone.  I was not able to view any photos in my backed up photo library, after entering Time machine.  Now, I can't even open iPhoto on my iMac with the pop up box warning me that the library is a Time machine backup....which it shouldn't be, because I'm openning iPhoto on my Mac...NOT the external HD.
    What happened, and how do I access my photos?

    It sounds like you went into the Time Machine hard drive, found a library and "dragged" it to your Pictures folder or wherever on your hard drive.  That's not the way to do it.
    Go to your Pictures folder and enter Time Machine via the TM menu in the menu bar:
    Then follow the instructions in this screenshot:
    OT

  • I can't access iPhoto any more??? This is the message I'm receiving......The iPhoto library is a Time Machine backup, and so cannot be used as the main library. Reopen iPhoto with the Option key held down to choose another library." Help!!!! Please!!!!!

    What does this mean? I had my computer restored and now i cant use iphoto..... i had it restored from a back up from feb 2013... my mac is missing a few things since but iphoto is a necessity these days..... Help me.... Help me please.....!!!

    SOrry - that is not a result of launching iphoto while depressing the option key - to help you we need to know what you have and the results of this question are important to that
    LN

  • Rebuild iPhoto library?  I have opened iPhoto with Command   Option keys held down.  I get the Photo Library First Aid window.  When I hit the repair button for the repair permissions command, iPhoto opens and nothing else happens.  What do I do now?

    I have opened the iPhoto First Aid window.  When I press the repair button for the repair permissions operation, nothing happens but my iphoto opens at the place I have been stuck since July 3.  What do I do now.

    How big is your library?  You should see the following:
    OT

  • New SSD only boots when option key held down.

    I recently cloned the original HDD in my mid-2009 MBP [2,53] to a brand new SSD. I put the SSD in an external enclosure, formatted and then cloned.
    Then I put replaced the internal HDD with the SSD and put the HDD to rest in a drawer forever. If I hold down option upon startup, I'm able to choose the new SSD and launch. But if I just turn my MBP on, I simply get a white/grey screen.
    Not a giant problem, but not sure why it would not just boot normally. Is there some kind of step required to make the new SSD the default startup drive?
    Thank you.

    Shootist007 wrote:
    Also if this one one of these new iMacs that come with the bluetooth wireless keyboards that is also the problem. These BT keyboard are not recognized right away when the system turns on so it is a Hit & Miss type of thing getting any of the Boot Options to work correctly. If you press to soon it is not registered. If you pres to late the system has already bypassed the system to use the boot option keys. this is not only for the Option key press to bring up the Boot selection screen. it also doesn't work for the Recovery HD boot or the boot from DVD key and any other boot option keys.
    As far as I can tell the window in which you should press the key runs from the start (but not before) of the chime to before it ends (bit vague).

Maybe you are looking for

  • Can anyone give a list of upgradeable performance parts for a mid 2012 macbook pro 13"?

    I have a non Retina display mid 2012 macbook pro that I want to do a home refurbishment and mass upgrade on, the processor and graphics cards are both good as is but RAM gets a bit bottlenecked with only 8gb, Id like to be able to replace the built i

  • Expdp error with query parameter

    i am trying to use datapump and using query parameter in there as below... but when i use the below, its exporting some system "repcat$" tables and nothing realted to scott.audit table or anything realted to my query where clause...what am i doing wr

  • Steps to create Smartform?

    Hi, I am new to smartform. Can anyone tell me steps to create Smartform? Regards, Sanjay.

  • IOS update image every second?

    Hello, I am very new to app development, so apologies for the simple questions. I have an image on a remote server of which updates every second, now I would like to put that image in a view in an app and have it effectively refresh every second. Cur

  • Writback Error

    Hi , I am trying to insert records in a report using Writeback feature. I am getting the following error : Write Back Error An error occurred while writing to the server. Please check to make sure you have entered appropriate values. If the problem p