[pve-devel] vnc console tab button fixing !

Alexandre DERUMIER aderumier at odiso.com
Mon Aug 20 17:40:44 CEST 2012


Hi,

I just found a working patch to correct the tab button in java console

Reference is here :

http://dogfeathers.com/mark/java7issue.html

I correct the tab button problem, also alt-gr special key (like €).
I have tested it under linux, java6. 


This patch seem to resolv also the problem with java7. (I see user reports on windows with java7)

Maybe can we do a test package and tell to users to test it on different platform ?


Just put this code at the beginning of init, in VncViewer.java

 public void init()
  {
      Container topParent = null;
      Container parent = this;
      // The natural thing would be to call getParent() until it returns
      //   null, but then you would be looping for a long time, since
      //   PluginEmbeddedFrame's getParent() returns itself.
      for (int k=0; k < 10; k++) {
          topParent = parent;
          parent = parent.getParent();
          if (parent == null) break;
      }

      // If topParent isn't a KeyEventDispatcher then we must be in some
      //   Plugin version that doesn't need the workaround.
      try {
          KeyEventDispatcher ked = (KeyEventDispatcher)topParent;
          KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
          // You have to remove it twice, otherwise the problem isn't fixed
          kfm.removeKeyEventDispatcher(ked);
          kfm.removeKeyEventDispatcher(ked);
      } catch (ClassCastException e) {}
    }



More information about the pve-devel mailing list