Using java to listen for a keypress when the program is not in focus

I want to set up a program where no matter what other program I'm using, when I press Ctrl+F1 my program will take focus and run another function or two. Is this possible and if so how can it be done?
Thanks.

Ok Mr. Smartass...Ok
I'm building a browser that is always open, and when
a user presses Ctrl+F1 (notice, just those two keys,
I don't care what else they press...) the browser
will open up. That way, you don't have to wait for it
to load all the time.You have two ideas here. One is having a universal key map that always gets ctrl-f1 sent to your app. The other is a program that is constantly running so that you don't have to wait for it to open up. The former is not possible (and this is a good thing) As warneria and I have been saying, it is bad design for an app to try to force an OS to implement this kind of feature.
If you're not going to help please don't post at all;
it's a waste of time for both you, me, and anyone
else who may need help on the same subject. Why wouldBelieve it or not, I am helping you.
See
http://www.google.com/search?hl=en&lr=&q=programming+code+side+effects
and
http://www.faqs.org/docs/artu/ch04s02.html
"Doug McIlroy's advice to �Do one thing well� is usually interpreted as being about simplicity. But it's also, implicitly and at least as importantly, about orthogonality."
anyone in their right mind who's trying to steal
people's passwords come out and say, "I'm not trying
to steal people's passwords!"wait, your question is why would someone trying to steal passwords say I'm not trying to steal passwords? I think duplicitous people in their right minds might try to trick you that way.
Beyond that, even if you're not a malicious hacker - and I am sure you are not - if someone posts a solution to your problem, malicious coders then will have learned how to do it. If you think you're programming or using these forums in a bubble, you are not.

Similar Messages

  • How to listen for key press when air app does not have focus

    Hi,
    I am developing a application in air and part of the functionality I need is the ability for the app to listen for when a specific key is pressed, even when the air app does not have focus.
    Is there support for this for windows or mac? If not, how might this be accomplished? ANE?    

    Ok Mr. Smartass...Ok
    I'm building a browser that is always open, and when
    a user presses Ctrl+F1 (notice, just those two keys,
    I don't care what else they press...) the browser
    will open up. That way, you don't have to wait for it
    to load all the time.You have two ideas here. One is having a universal key map that always gets ctrl-f1 sent to your app. The other is a program that is constantly running so that you don't have to wait for it to open up. The former is not possible (and this is a good thing) As warneria and I have been saying, it is bad design for an app to try to force an OS to implement this kind of feature.
    If you're not going to help please don't post at all;
    it's a waste of time for both you, me, and anyone
    else who may need help on the same subject. Why wouldBelieve it or not, I am helping you.
    See
    http://www.google.com/search?hl=en&lr=&q=programming+code+side+effects
    and
    http://www.faqs.org/docs/artu/ch04s02.html
    "Doug McIlroy's advice to �Do one thing well� is usually interpreted as being about simplicity. But it's also, implicitly and at least as importantly, about orthogonality."
    anyone in their right mind who's trying to steal
    people's passwords come out and say, "I'm not trying
    to steal people's passwords!"wait, your question is why would someone trying to steal passwords say I'm not trying to steal passwords? I think duplicitous people in their right minds might try to trick you that way.
    Beyond that, even if you're not a malicious hacker - and I am sure you are not - if someone posts a solution to your problem, malicious coders then will have learned how to do it. If you think you're programming or using these forums in a bubble, you are not.

  • We have 2 itouchs, we a separate itunes account for each one. We have one home computer to use them both on for syc and icloud, the icloud will not accept the 2 accounts?

    we have 2 itouchs, we a separate itunes account for each one. We have one home computer to use them both on for sync and icloud, the icloud will not accept the 2 accounts?

    Do you know what happens if you delete the icloud account from an iphone 4s?  Will it delete the pictures, documents, etc. from the phone, or just unlink the icloud from the phone?  I want to associate a different icloud account to the phone.

  • [SOLVED] - Thunderbird constantly crashing, especially when using Add Ons Manager, but sometimes just when the program has been sitting open.

    Hello,
    I was using Thunderbird earlier today when the power went out in my neighborhood. Since the power has been restored Thunderbird has been crashing early and often. I can't get the program to open unless I rename or delete the "extensions" folder in ~\Library\Thunderbird\Profiles\<Profile Name>
    It will crash immediately if I go to Tools--> Addons. Eventually it will just crash from just sitting open in the background. I've attached the crash report below. I'm on OSX 10.10.1
    I've tried deleting and reinstalling Thunderbird (both the current and previous version)
    I've tried repairing permissions
    I've tried using Time Machine to restore the entire Profiles folder from before the power outage.
    Any suggestions? I've been using Thunderbird for years and I'm quite comfortable with it, but might have to switch to Postbox if I can't fix this.
    Thanks.
    AdapterDeviceID: 0x6720
    AdapterVendorID: 0x1002
    Add-ons: %7B972ce4c6-7e08-4474-a285-3208198ce6fd%7D:31.3.0
    BuildID: 20141127140543
    CrashTime: 1419384832
    EMCheckCompatibility: true
    EventLoopNestingLevel: 1
    FramePoisonBase: 7ffffffff0dea000
    FramePoisonSize: 4096
    InstallTime: 1419372200
    Notes: AdapterVendorID: 0x1002, AdapterDeviceID: 0x6720GL Layers! GL Context? GL Context+ GL Layers+
    ProductID: {3550f703-e582-4d05-9a08-453d09bdfdc6}
    ProductName: Thunderbird
    ReleaseChannel: release
    SecondsSinceLastCrash: 22
    StartupTime: 1419384814
    Theme: classic/1.0
    Throttleable: 1
    Vendor:
    Version: 31.3.0
    useragent_locale: en-US
    This report also contains technical information about the state of the application when it crashed.

    That did it, thank you!
    It was located in ~/Users/<username>/Library/Internet Plug-Ins

  • Is there a way to turn off calendar notifications for ical and outlook when the program is not active?

    Hi - i'm finding these to be a little bit annoying, anyone know how to do this?  The Outlook ones bug me more than the iCal ones.  Also, i'm wondering if that is hurting battery life to have that running the background.

    I'd install Better Touch Tool (free). Add two gestures for Finder ONLY that have "No action" associated with them. This disbales pinch/zoom on the desktop AND in any Finder window, but not in any other application.
    If you'd like to occasionally use pinch to zoom in the Finder (to zoom into a photo thumbnail for example), then add two more gestures, again for Finder ONLY - but this time also selecting one of the modifier keys (e.g. "Option" key). For these gestures set as "Use Apple Default or do nothing".
    Together, this enables disabling of the zoom feature (to prevent accidental zooming of the desktop icons for example). But whenever you'd like to zoom into a document or photo etc in a Finder Window (which are also now disabled), you can now simply hold down "Option" key and the Pinch functions work again.
    This solution works for me on 10.6.8

  • Hello, I have created a distribution kit for my program.The problem is that the when the program is installed onto another computer, it fails to communicate with field point (Using FP-AO-200 and FP-AO-1000). Help is greatly appreciated, Thanks faen9901

    Hi Everyone,
    I have a program that sends information(analog output) to lab windows cvi in the form of a text file or user input.
    The program runs on the computers that I have the field point explorer and lab windows cvi installed on. In order to run the program without always installing labwindows/cvi and field point; I wanted to create an executable file that could be load on another computer.
    I used the create distribution kit part of labwindows/cvi to do this.After creating the distribution kit, I then installed it
    to another computer.
    My user interface appears on the screen, when the user clicks on the exe. file, but no data is sent to the field point module. I know that the data is being read from the user and textfile because in it appears in the uir.
    The following are some details about the problem:
    1. On another computer without labwindows/cvi and field point explorer not installed - no data is sent to field point module
    I know this because a current is being read on the current meter connected to field point module.
    My questions are the following:
    1. What are the possible reasons for the data not being sent to the field point module?
    2. Do I still need to create an iak. (Installing Field point Explorer) file stored on any new computer that I install my created distribution kit file too?
    Thankyou very much for any help that you can provide. I greatly appreciate it.
    Faen9901

    Re: Hello, I have created a distribution kit for my program.The problem is that the when the program is installed onto another computer, it fails to communicate with field point (Using FP-AO-200 and FP-AO-1000). Help is greatly appreciated, Thanks faen9901Faen9901,
    1) If you do not install FieldPoint Explorer, the FieldPoint Server is not installed so there is nothing on the target computer that knows how to talk to the FieldPoint system.
    2) Yes, you need an IAK file on the target computer. Assuming the settings (i.e. com port#) are identical you can simply include the iak file as part of the distribution.
    3) You also need to include as part of your installer the file "fplwmgr.dll". If this file is not installed, your program will not be able to access the FieldPoint Server. Alternatively, this file is installed automatically if FieldPoint Explorer detects LabWindows/CVI or Measurement Studio Development versions on the target computer or if you choose to do a custom FieldPoint Explorer installation and
    choose to provide LabWindows/CVI support.
    Regards,
    Aaron

  • Using Java to dev for Revo

    Hi,
    I would like to use Java to develop for a Revo (EPOC Symbian OS). Does anyone have any ideas about were I could look for support? Does anyone know if it is possible?
    Thx in advance,
    Matthew

    http://www.google.com/search?q=java+revo

  • I am using iPhone 4 : i OS 7. When the phone is in sleep mode i cannot disconnect unwanted incoming call, Is there any upgrade coming for this for iPhone 4 users

    Dears,
    I am using iPhone 4 : i OS 7. When the phone is in sleep mode i cannot disconnect unwanted incoming call, Is there any upgrade coming for this for iPhone 4 users. How this can be sorted

    Hello Bibhore,
    Calls can be declined by hitting the sleep/wake button twice quickly.
    Decline a call and send it directly to voicemail. Do one of the following:
    Press the Sleep/Wake button twice quickly.
    iPad User Guide - When someone calls
    http://help.apple.com/ipad/7/
    Cheers,
    Allen

  • How do I preserve the embedded hyperlinks when printing to .pdf?   I am using Acrobat Pro XI for Mac, and when I export to .pdf the existing hyperlinks lose functionality.   I assume it's just the flick of the right button – I just need help finding that

    How do I preserve the embedded hyperlinks when printing to .pdf? 
    I am using Acrobat Pro XI for Mac, and when I export to .pdf the existing hyperlinks lose functionality.   I assume it’s just the flick of the right button – I just need help finding that button. 
    Can you help?  Thanks!

    How:  MS Word to .pdf by Command P, hitting the PDF button, and then the button for "save as Adobe pdf"
    I didn't have this problem at all on prior versions of Adobe on my PC.   This isn't a Mac attack, is it?

  • TS3899 I can  no longer send photos in an email from my iphone 5. It uploads the photo to the "new message" page - and then it freezes. I can use safari and check my emails, and when the email part is frozen the rest of the phone works fine ! any advice?!

    I can no longer send photos in an email from my iphone 5. It uploads the photo the the "mew message" page and then it freezes! I can use safari and check my emails, and when the email part is frozen I can still use the rest of my phone. Any advice ?!?

    Hi, ireland a. 
    I would recommend closing any open applications in multitasking and restarting the device.  If unfamiliar with multitasking, I have included a screenshot on how to process an application close. 
    iOS: Force an app to close
    Once these steps are processed, attempt to send the photo again. 
    iPhoto for iOS (iPhone): Send photos by email
    http://support.apple.com/kb/PH3271
    Regards,
    Jason H. 

  • My ipod keeps searching for network, even when the network info is all set properly. It has suddenly started doing this. Also, buffering forever...

    My ipod keeps searching for network, even when the network info is all set properly. It has suddenly started doing this. Also, buffering forever... I have tried to reset the network few times, but not working.

    Hello Nazer_502,
    I would be concerned too if my iPhone was acting this way.  It sounds like it is overheating and not holding a charge. I recommend following the steps listed below when experiencing an issue like this:
    Battery life seems short
    Click ( www.apple.com/batteries/iphone.html) for tips on how to prolong iPhone's battery life.
    Try turning iPhone off and then on again.
    Connect iPhone to iTunes and restore iPhone.
    If the screen shows a low-battery image, the battery is low on power and needs to charge for up to ten minutes before you can use it.
    When charging iPhone, make sure to leave it charging until it is fully charged. You'll know the battery is fully charged when the battery icon in the upper-right corner of the screen looks like this .
    Note: When charging using a computer, don't connect iPhone to a keyboard. Also, the computer must be turned on and not in sleep or standby mode. If iPhone is connected to a computer that's not turned on or is in sleep or standby mode, the iPhone battery may drain.
    You can find the full article here:
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/ts2802
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Where-used for FM somethimes colors the program in red- why?

    Hello,
    Small question for something that i've noticed:
    When i do Where-used for FM somethimes the program is colored in red- anyone knows why?
    Thanks,
    Moshe

    Hi,
    In a where-used list for a function module the programs coloured in pale red are inactive.
    Regards,
    Nick

  • "Waiting for real-time target (RT PXI target) to respond" error when the program waits interrupts

    Hi there,
    I have developed an application to detect interrupts generated by a electronic card and act in consequence. The program has been developed in labview but it calls a dll; that was created with labwindows. The dll is programmed to open the visa communication, enable events and install the interrupt handler and when an interrupt is detected, it reads the value of the different registers of the card and returns it to labview to visualize them. 
    The problem is that when the program waits for an interrupt, a prompt appears with the message "Waiting for real-time target (RT PXI target) to respond" and the only option I have is to click on the button to disconnect from the pxi or just wait. If I wait and I generate an interrupt, the prompt disappears and the application visualize the data like it was expected. 
    To wait for the interrupt the following code has been programmed in the function:
                    while (flag == 0)
                                    Sleep (1000);
    When an interrupt occurs, the value of flag changes to 1 and the function continue without any problem. I am not really sure, but probably here is the problem and probably this is not the best way to wait for an interrupt because the sleep function suspends the thread for the configured time, but at least the computing load in the PXI is between 0% and 1%. I was wondering if somebody knows how to wait for an interrupt without "lost" the communication with the PXI and if there is a better way to do it. 
    Any answer will be welcome and thanks for them,
    Jaime
    Solved!
    Go to Solution.

    Hello Naity,
    First of all, in which thread runs the waiting process? Is it scheduled in another thread than the function setting the flag?
    It scheduled in the same thread that I use to configure the communications and configure the card. Anyway, here is the pseudo code of the function interrupt that I programmed under labwindows,.
    char* interrupt(void)
    1. Open visa communications
    2.Install handler interrupt --> status = viInstallHandler (instr, VI_EVENT_PXI_INTR, IntrHandler, VI_NULL);   // the function IntrHandler will be called when an interrupt occurs
    3. Enable event PXI interrupt
    4. Wait
    while (flag == 0)
                  Sleep (1000);
    5. Visualize the data coming from the interrupt (registers and values measured with the card)
    6. Uninstall handler interrupt
    7. Close visa session
    The interrupt handler function IntrHandler is called immediately when an interrupt occurs and the pseudo code is like this
    ViStatus _VI_FUNCH IntrHandler(ViSession instr, ViEventType etype, ViEvent event, ViAddr userhandle)
    1. Disable some functions of the card to avoid damages. 
    2. Read registers and put them in a buffer
    3. Change the value of flag ---> flag = 1;
    In labview, I call the function interrupt with a call library function node (see the capture attached) and the program reads and saves the data from returned from the function.
    Secondly, I am not sure this method is the most elegant. You could for example register an event with the function and, insteand of setting a flag to 1, trigger the event and schedule it in another thread (if the function is thread safe). This could reduce your CPU Load even more and seem a bit cleaner to me.
    I've never used events before in labwindows but I will try to do it in this way. But anyway, I suppose that I should; somehow, wait the event to occurs in labview while the waiting for the event is programmed inside the dll...and probably the same prompt that i am trying to avoid is going to appear again, because I am not returning the "control" to labview (I mean, labview executes the dll and waits for the event to occur. Then the execution of the labview program is stopped in the call library function node executing the dll)
    Third point, which environment of development are you using?
    I am working with LV 2010 sp1 and Labwindows cv 10.0.1 and with the real time module.
    I did also another test, I divided the program in different functions, one to initialize the communication, another to wait until a interrupt has been detected and the other to obtain the data from the interrupt and close communications. With labview I call first with the call library function node the function to initialize, later I call inside a while loop the wait function like this
    int waitAseconds (double seconds, short stop_waiting)
    if(flag==1 || stop_waiting == 1)
    flag = 1; //to detect the stop_waiting button
    printf("flagAA =1 stop waiting = %d time = %d\n", stop_waiting, clock());
    return flag;
    else
    SleepUS(seconds*1000000);
    //a++;
    printf("flag a= %d stop waiting = %d time = %d\n", flag, stop_waiting, clock());
    return flag;
     and when the program detects an interrupt, the function returns to labview the flag and stops the loop. Finally, it reads the values and close communications. 
    In this way, the prompt appears but after running the application for 10 or 20 minutes and also i checked that there is a time gap between the executions in the loop.
    Thanks for your reply and your help,
    Jaime
    Attachments:
    capture.png ‏40 KB

  • TS3212 Trying to download iTunes 10.7 in Windows 7 64-bit. When I click the download now button, it immediately goes to the "Thank you for downloading" screen, but the file has not downloaded. Popups unblocked. Any thoughts? Thanks!

    Trying to download iTunes 10.7 in Windows 7 64-bit. When I click the download now button, it immediately goes to the "Thank you for downloading" screen, but the file has not downloaded. Popups unblocked. Any thoughts? Thanks!

    I'd first try downloading an installer from the Apple website using a different web browser:
    http://www.apple.com/quicktime/download/
    If you use Firefox instead of IE for the download (or vice versa), do you get a working installer?

  • How do I Install or re-buy iPhoto for my Mac when the app can't lunch?

    How do I Install or re-buy iPhoto for my Mac when the app can't lunch?
    The App Store does not let me buy iPhoto from scratch nor update it. I used the original Applications Install DVD to re-install iPhoto, and the icon appeared but the app could not be used because iPhoto 2.1 is not compatible with the Mac operating system OS X (10.9.2)? I thried to update manually through apple support, and a notification of unauthorized licence did not let it happen.  What is this? What happened with my iPhoto? What can I do to solve this and safe my photos? I'm willing to pay for it, but even the app store say that it can't becuase it was suppousely bought through another account? Please help!

    Not launching is probablay not a software issue - it is probably a data issue
    No - iPhoto 2 version 2.1 is not compatible with Mavericks - or pretty much anything else - you need to purchase iPhoto '11 version 9.5.x from the App store
    LN

Maybe you are looking for

  • Error when creating a new Portfolio

    Hi guys, When I try to create a new Portfolio, I get the following error message:                "The value of the mandatory input field Portfolio Type is initial" This error occurs in spite of the field being populated with a valid Portfolio Type. C

  • What is new Gl account?what is the purpose of using that New Gl?

    What is new Gl account?what is the purpose of using that New Gl?

  • Not able to resize and make a partition of my startup disk

    Hi, I'm running Lion on a late - 2010 15 inch MBP and I already have a Boot Camp partition of Windows 7. I wanted to partition my hard drive again to install Ubuntu (which should be relatively painless). I tried out the live CD to get a taste of what

  • Needs help in writing an sql.

    Hi Gurus, Here is my sql select c.owner,c.table_name, c.num_rows,(c.num_rows-t.num_rows)"ROW_DIFFERENCE" from scms_tabs c,eosenv35_tabs@demoeos t where c.num_rows-t.num_rows >0 i have 164 tables in both the tables scms_tabs and eosenv35_tabs@demoeos

  • How to hide certain rows of data?

    I am creating a table where there is an option for the particular to be hidden. What do I do in HTMLDB to make that particular row to stay hidden "forever"? Ex: ID Name Hide 1 joe N 2 john N Now after I edit the data of joe to Hide=Y I want the table