Inactive Window - keyListener

i have a problem. I wrote a program, that reacts on a keyevent. That works, but only if the window of my program is active. And theres the problem, because it should even react on the keyevent if another window is active.
It this possible in Java? If not, what are the alternatives?
judy

Hi judy333!
Unfortunatelly I never exploited this issue in Java, but think about calling C-language programs just to listen environment events and to notify program, ie; removing from dormant state (inactive). As you can see, it is a hack on OS, be careful! In past I was successful using Object Pascal and MASM but I do not consider it a good solution!
Good luck and success!
(also try forum about native methods)

Similar Messages

  • XFWM (XFCE Window Manager) hover effect for inactive windows

    I use XFCE and its window manager, XFWM, and I quite like it. The only little thing that XFWM does not do, and that I really would have liked, was a visual effect: When hovering titlebar's buttons, there is usually a little effect. It's just a visual thing, but it also "confirms" which button you're about to click, and - maybe as a Windows user - I'm used to it, and to rely on it to check responsiveness and whatnot.
    Anyways, while XFWM does support such a thing (depends on your theme, actually), it does so only for the active window. Inactive windows, or their decorations/button, will not react to mouse hovering. So I looked into it, and while this isn't supported by XFWM, it's quite easy to change it.
    So I did, if anyone is interested the modified source code is available on this BitBucket repository, and you can also find a PKGBUILD in the AUR.

    You should submit this upstream! Looks like a nice feature to add, imo

  • Clicking inactive windows

    Recently I have been having issues with clicking inactive windows. This seems to happen a lot especially when using Photoshop or other CS4 applications. I can see the inactive window, e.g. safari in the background but cannot click on the window. CS4 / other application remains active and the only way I can switch to the other application is clicking on the dock icon, using exposé or Cmd-Tab.
    Has anyone else had these issues at all as it is seriously hampering my productivity and becoming increasingly frustrating.

    Hi Jan,
    Thank you for your reply. Indeed those timer values were not covered in the ISE design guide. We have implemented this timer to tweak the standard design. However we have finally discovered the solution for this issue.
    "authentication timer inactivity 120" was the route cause of the issue. So when a workstation goes to idle, ISE tries to re-authenticate after 2 minutes because of this switch port configuration.
    We have tried to expand the timer to 3600 and it worked, issue fixed. But you will have then every one hour the same result (not a big issue).
    And yes, we have deleted all those timer values to keep the configuration simple as possible. Now we don't have the issue anymore.

  • How to send keystroke to inactive window?

    I need to know how to send a keystroke to an inactive window.
    Right now i can use the Robot class and send key strokes to the active window but I need to be able to send it to an inactive window.

    if you just want to send keys to another java app, this is a kludge hack, windows only
    run frame1 and frame2 as separate apps, have them both visible on the screen, focus on frame1.
    click the button to send 'enter' to frame2, which will (should) display the JOptionPane
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Frame1
      public void buildGUI()
        JButton btn = new JButton("Send Enter");
        JFrame f = new JFrame("Frame1");
        f.getContentPane().add(btn);
        f.setBounds(300,100,400,300);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
        btn.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ae){
            sendEnterToFrame2();
      public void sendEnterToFrame2()
        try
          java.io.File file = new java.io.File("ActivateFrame2.vbs");
          java.io.FileWriter fw = new java.io.FileWriter(file);
          fw.write("set ws = WScript.CreateObject(\"WScript.Shell\")\r\nws.AppActivate \"Frame2\" \r\n set ws = nothing");
          fw.close();
          Runtime.getRuntime().exec("WScript.exe ActivateFrame2.vbs");
          file.deleteOnExit();
          Robot robot = new Robot();
          robot.delay(1000);
          robot.keyPress(KeyEvent.VK_ENTER);
          robot.keyRelease(KeyEvent.VK_ENTER);
        catch(Exception e){e.printStackTrace();}
      public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            new Frame1().buildGUI();
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Frame2
      public void buildGUI()
        JButton btn = new JButton("OK");
        JFrame f = new JFrame("Frame2");
        f.getContentPane().add(btn);
        f.setBounds(700,100,400,300);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.getRootPane().setDefaultButton(btn);
        f.setVisible(true);
        btn.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ae){
            JOptionPane.showMessageDialog(null,"OK");
      public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            new Frame2().buildGUI();
    }

  • Inactive Windows 7 supplicant tries to reauthenticate every 4 to 10 minutes in Cisco ISE 1.2.1.899

    Hi,
    We have a dashboard windows 7 supplicant which is being used to monitoring the network activities. There is noone working with this supplicant so it goes inactive.
    What we see in our ISE log, is the supplicant trying to reauthenticate itself every 4 to 10 minutes. It goes on like this the whole day. We dont want this continous behaviour afterall.
    Swith port configuration looks likt this:
    interface FastEthernet0/31
    description 802.1x Poort
    switchport access vlan xxx
    switchport mode access
    switchport nonegotiate
    switchport voice vlan xxx
    no logging event link-status
    priority-queue out
    authentication control-direction in
    authentication host-mode multi-domain
    authentication order mab dot1x
    authentication priority dot1x mab
    authentication port-control auto
    authentication timer inactivity 120
    mab
    no snmp trap link-status
    dot1x pae authenticator
    dot1x timeout quiet-period 300
    dot1x timeout tx-period 10
    dot1x timeout supp-timeout 300
    dot1x max-reauth-req 3
    dot1x timeout held-period 300
    dot1x timeout auth-period 3
    no mdix auto
    storm-control broadcast level 10.00
    storm-control multicast level 10.00
    no cdp enable
    spanning-tree portfast
    service-policy input xxxx
    end
    Has anyone got this same issue? Is this an normal behaviour of an Idle'd supplicant? or other issue around ISE/Switch? Are there any switch configuration we missing to get rid off this behaviour?
    ISE Version: 1.2.0.899
    Patch Information: 5,6,8
    Help would be much appreciated

    Hi Jan,
    Thank you for your reply. Indeed those timer values were not covered in the ISE design guide. We have implemented this timer to tweak the standard design. However we have finally discovered the solution for this issue.
    "authentication timer inactivity 120" was the route cause of the issue. So when a workstation goes to idle, ISE tries to re-authenticate after 2 minutes because of this switch port configuration.
    We have tried to expand the timer to 3600 and it worked, issue fixed. But you will have then every one hour the same result (not a big issue).
    And yes, we have deleted all those timer values to keep the configuration simple as possible. Now we don't have the issue anymore.

  • Floating inactive windows behind photoshop

    I work on Mac and CS6.  My inactive images float BEHIND Photoshop, forcing me to minimize PS to access these windows.  How do I get these inactive images to stay on top where I can easily access them

    Uncheck Open documents as Tabs in Preferences > Interface.

  • Window keylistener

    Hi,
    i wanna add a keylistener to the keyboard , i mean if i run my program it will listen to all the typed keys, ?
    so can i put a keylistener on a window ? or is there a keylistener which listen only to the keyboard , even if my window is not selected ?
    i hope u got me :)
    thank you for your help

    Hi,
    I hope we can do that with JNI and KeyboardHooking.
    this code worked fine when the aplication has the focus , but it didn't work when the applicaion is out of focus, i dont have any clue about that.
    #include <stdio.h>
    #include <windows.h>
    #include "jni.h"
    #include "JNIFrame.h"
    #include <process.h>
    //HINSTANCE hInst;
    //HHOOK g_hook = NULL;
    jclass cls1;
    //jobject obj1;
    JNIEnv *env1;
    //JavaVM *pJavaVM;
    jmethodID mid;
    #pragma data_seg("Shared")
    HHOOK g_hook = NULL;
    HINSTANCE hInst = NULL;
    JavaVM *pJavaVM = NULL;
    jobject obj1 = NULL;
    #pragma data_seg()
    #pragma comment(linker,"/SECTION:Shared,RWS")
    LRESULT CALLBACK KeyboardProc(int code, WPARAM wParam, LPARAM lParam);
    int WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID lpvReserved);
    int WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID lpvReserved)
    hInst=hInstance;
    return TRUE;
    JNIEXPORT void JNICALL Java_JNIFrame_initialize(JNIEnv *env, jclass cls,jobject obj)
    //jclass cls = (*env)->GetObjectClass(env, obj);
    cls1=cls;
    obj1=obj;
    env1=env;
    //g_hook = SetWindowsHookEx(WH_KEYBOARD,(HOOKPROC)KeyboardProc, hInst,(DWORD)NULL);
    env->GetJavaVM(&pJavaVM);
    mid = env->GetMethodID(cls, "callback", "()V");
    g_hook = SetWindowsHookEx(WH_KEYBOARD,(HOOKPROC)KeyboardProc, hInst,(DWORD)NULL);
    LRESULT CALLBACK KeyboardProc(
    int nCode, // hook code
    WPARAM wParam, // current-process flag
    LPARAM lParam // address of structure with message data
    JNIEnv *__env;
    printf("sravan5");
    #if defined(JDK1_2) || defined(JDK1_3)
    pJavaVM->AttachCurrentThread((void**)&__env, (void*) 0);
    #else
    pJavaVM->AttachCurrentThread(&__env, (void*)0);
    #endif
    if(nCode>=0)
    // jmethodID mid = __env->GetMethodID(cls1, "callback", "()V");
    if (mid == 0) {
    printf("sravan4");
    return 0;
    printf("sravan5");
    __env->CallVoidMethod(obj1,mid);
    return CallNextHookEx(g_hook, nCode, wParam, lParam);
    JNIEXPORT void JNICALL Java_JNIFrame_unHook
    (JNIEnv *, jclass, jobject)
    UnhookWindowsHookEx(g_hook);

  • STOP inactive windows from dimming itself!

    How can I stop inactive browser or window from dimming itself while I am working on other application?
    This feature is like HazeOver before OSX Lion, and now it seems it is implemented in LION and MT LION.
    It is very very annoying and reduces productivity~
    I need to be able to view references on browser or youtube clips while I am working on other applications such as WORD or PhotoShop~
    But OSX just dim the browser when I am putting them at the background.
    Please APPLE~ fix this or at least give users a choice to turn this stupid feature OFF!!

    I solved the proboem. It turnes out to be my own problem.
    I installed APP TAMER long time ago, and that is the program which causes the dimming problem.
    If anybody else has the same problem, goto APP TAMER's perferances and turn off dim window...
    Sorry for accusing OSX LION... my bad~~

  • Can't scroll through PDF in an inactive window/can't email from Chrome

    I've been using the built-in Chrome PDF viewer up to this point.  I changed over to the Adobe Viewer plugin because it allows me to email the PDF directly from the browser window/tab while the Chrome viewer does not.  However, it seems I've traded one feature for another...  With the Chrome PDF viewer, I could move the tab containing the PDF into its own window on a separate screen, click on a text field in another window, put the cursor back on the PDF (without clicking) and scroll through it with the mouse wheel while SIMULTANEOUSLY typing in a text field in the original Chrome tab. Basically, the cursor just sits on the PDF window, scroll when I need to and I type in another window.  However, when I activate the Adobe Reader plugin, I can no longer do this; I have to click on the PDF within the new Chrome tab, scroll, then click on the text field on the other Chrome field.  It may not sound like a big deal, but I am sifting through literally thousands of documents a day looking for specific information then documenting that information on another screen, so being able to type and scroll without the constant back-and-forth clicking is extremely helpful. I've tried dozens of seemingly related options in Adobe Reader, but I cannot find any combination of settings in Documents, General, Page Display or Internet that yield the desired result.
    The flip side of my dilemma, as hinted in the beginning, is that I need the ability to email PDFs directly from the browser without saving it to the computer (i.e., the email icon on the Reader toolbar opens an Outlook email window).  As best as I can tell, there is no way to do that with the built-in Chrome PDF viewer and thus I switched to the Adobe Reader. 
    Ultimately, I don't care whether I wind up with Reader that allows the scrolling functions that I desire or Chrome Viewer that allows me to email, though I'd prefer to just stick with the Chrome PDF viewer if that's possible.
    Help and suggestions are appreciated!

    Thanks, for responding, Pat.
    Win7 Professional and Adobe Reader 11.0.07, plugin version 11.0.07.79
    I'll try to clarify the problem.
    On screen one I have a Chrome window open with data fields and a list of links that take me to PDFs.  On screen two I have another Chrome window open; when I click on the PDF links on screen one, the PDF opens on screen two. (1) I move the cursor to one of the text fields on screen one and start typing. (2) I then move the cursor (without clicking) over to screen two and using the mouse wheel, scroll down in the document.  (3) Next, I continue typing in the text field on screen one - again, my cursor is still on screen two, having just scrolled down. (4) I'll then scroll some more and (5) continue typing in the text field on screen 1, open a new PDF and repeat. Again, the issue Adobe Reader plugin causes is that it creates extra steps between 1 & 2 (I have to click on the PDF to scroll), 2 & 3 (I have to move the cursor back to screen one and click in the text field), 3 & 4 (I have to move the cursor back to the PDF and click again to scroll), etc. etc. 

  • How can I check inactive window.

    Hi all,
    I have a question on Swing programming. I have a JFrame and I would like to check that
    It active or non-active.
    Active means, It's on a desktop.
    Nonactive means, It's on a toolbar.
    How can I do?
    Thank you.

    hi friend, want to say one thing to you, reading manual / API is a good good habbit :
    public int getExtendedState()
    Gets the state of this frame. The state is represented as a bitwise mask.
    NORMAL
    Indicates that no state bits are set.
    ICONIFIED
    MAXIMIZED_HORIZ
    MAXIMIZED_VERT
    MAXIMIZED_BOTH
    Concatenates MAXIMIZED_HORIZ and MAXIMIZED_VERT.
    you can use above method of Frame class( remember JFrame extends Frame :) )

  • V10.7 Lion - Windows constantly change to an inactive/background window.

    Every window: finder, safari, iCal, etc... automatically transitions to an inactive window after about 1-2" for no apparent reason. This prevents me from being able to type anything but a letter or two at a time before I need to click on the window again to make it the active window so my keyboard inputs will take effect.  Only object it does not seem to apply to is Quicksilver.  Ideas?  Already checked other input devices and turned them off, as well as reboots.

    If you look at Qicksilver/Preferences/Extras you'll see that there's an option to Hide other applications when switching. If this is checked then unchecking it should sort out the Quicksilver problem.
    I've now got Mission Control working as it should. I used to use an application iClip in SL and it wouldn't work in Lion, in fact I find it has been discontinued. There was no sign of it anywhere. However when I had a look at the list of Login Items for me in Preferences/Users & Groups it was shown there! I used the '-' below the list to remove it. I had also tried out Google Desktop but had stopped using it but there was an entry for this in that list too. There was also an entry in Preferences, under Other, and I uninstalled it there. I don't know which of these was causing the problem but it does seem to have sorted things out.
    I suggest that those who are still having problems with MC should have a look at these Login Items against their username in Preferences/User & Groups in case there's something shown there that might be causing their problem.

  • Closing windows when they are inactive

    hey peeps
    i have created a couple of tabs using JTabbedPane. I have got 3 tabs that are always meant to be visible and when the user clicks on a specific button, a new tab / windos opens up and let the user do more stuff. when the window becomes inactive (eg: the user clicks another button and another tab is created), how can i close that inactive window??
    thanks
    milos

    If you're just trying to sync music to your iPad with iTunes using Windows XP, here's a link to Apple's support which gives details on syncing and using your iPad with iTunes.
    http://www.apple.com/support/ipad/syncing/
    And here's the link to syncing specifically:
    http://support.apple.com/kb/HT1386

  • Can i change the color of the iTunes 12 window?

    I'm running Win 8.1 and iTunes 12.0.1.26, although this issue has existed in earlier versions of both.  The color (gray) and shade of iTunes 12 is the same color as an inactive Win 8 window.  When iTunes is active and on top, its edges blend right into any underlying inactive windows.  Is there a way iTunes can be given the same type of 'frame' color or perhaps a different, more contrasting color scheme when it is active and on top?

    This sounds like one for iTunes Feedback.
    tt2

  • How to get black text in window title

    I have difficulty distinguishing between active windows and inactive windows because the title text for both is a shade of gray. How can I theme OS X Lion to use black text  scrollbar, and controls for active windows; gray for inactive windows?
    I am tired of having to click on a window to ensure that it is active.

    Ha, I had the graphite theme, so they were gray. While they were darker than an inactive window, they still didn't call attention to themselves. I've switched to blue and now they're in color. Not sure why they are called "blue" and "graphite" as the only difference I notice is the color buttons, none of which are blue, for blue and the gray buttons for graphite. I still don't usually look over in that direction; I'm looking at the title to see if its the window I'm interested it. Still, that gets a helpful.
    Still, I'd really like black text as I find gray text harder to read. And the back/forward buttons in Firefox don't change enough between active and inactive. I'd like that to be really black. (I'm told that OS X theming interferes with being able to change that; not sure if it's true.)
    As for the active one usually being in front, that's assuming that the active one is taking up a majority of the real estate. I often have two windows side-by-side. Further, stickies don't have the three buttons, so it's no help when they're active (and there's a bug - which I've reported - that sometimes makes them inadvertently active).

  • XFCE, window effects and other questions.

    I really like XFCE mostly because it has what I need and it is really fast.
    Anyway, first I have activated a few effects and that is to have my inactive windows transparent and all windows titlebar it all working good. But is there any way to exclude any window from the transparency stuff?
    Another thing is that I have pidgin installed to use ICQ and MSN works nice, But is it posible to hide the "taskbutton" for pidgin on the task/window list that is normally at the top of the screen? And maybe also from alt+tab/middle-click menu.

    McZ wrote:Anyway, first I have activated a few effects and that is to have my inactive windows transparent and all windows titlebar it all working good. But is there any way to exclude any window from the transparency stuff?
    I don't think there's any way to do it within Xfwm, but you could try devilspie. It's in [extra].

Maybe you are looking for

  • Plant on goods receipt document

    Hi gurus We have a situation where a purchase order is created automatically for intercompany stock transfer deliveries. On the PO when we default the plant to be P001. But  the plant on FI doc, created by the goods receipt,  is different than the on

  • How do I get mac to only recognise my tv monitor when it is switched on?

    For example when my tv is switched off the cursor would be lost for a bit as it would be where the tv is. Also sometimes some windows would open in the tv monitor so to access it i would have to first turn the tv on. Is there a away for the mac to de

  • Balance Layout in CR

    Hi Experts:                   Im trying to make a new layout of a balance sheet with more fields than original. I was viewing standard layout in CR and i found a xml datasource and this layout doesnt have parameters. Have you tried doing this, becaus

  • B&W or Color Grain Plug-ins?

    In LR 2.0, I like to convert some of my images to B&W, but there's no utility to provide for film grain, like Tri-X and others. Is there a utility, either for free or for purchase that offers effective grain management? Thank you, Robert Ades

  • @ Start-up: Stuck after chime! No Apple Logo, No Spininng Wheel! But...

    OK I tried to enable front row on my old powermac. Long story short it didn't work and made my clock and search icons disappear from my menu bar. I found some info about how to restore both by by downloading an reinstalling the latest combo os update