if (keyMap.isKeyStrokeDefined(MNEMONIC_JUMP_PREV + ".alt2")) { ks = keyMap.getKeyStroke(MNEMONIC_JUMP_PREV + ".alt2"); getInputMap().put(ks,MNEMONIC_JUMP_PREV); getActionMap().put(MNEMONIC_JUMP_PREV,prevSession ); }
   private void initKeyBindings() {      KeyStroke ks;      Action newSession = new AbstractAction(MNEMONIC_OPEN_NEW) {            public void actionPerformed(ActionEvent e) {               me.startNewSession();            }        };      if (!keyMap.isKeyStrokeDefined(MNEMONIC_OPEN_NEW)) {         ks = KeyStroke.getKeyStroke(KeyEvent.VK_N,KeyEvent.ALT_MASK);      }      else {         ks = keyMap.getKeyStroke(MNEMONIC_OPEN_NEW);      }      getInputMap().put(ks,MNEMONIC_OPEN_NEW);      getActionMap().put(MNEMONIC_OPEN_NEW,newSession );      Action chgSession = new AbstractAction(MNEMONIC_TOGGLE_CONNECTION) {            public void actionPerformed(ActionEvent e) {               changeConnection();            }        };      if (!keyMap.isKeyStrokeDefined(MNEMONIC_TOGGLE_CONNECTION)) {         ks = KeyStroke.getKeyStroke(KeyEvent.VK_X,KeyEvent.ALT_MASK);      }      else {         ks = keyMap.getKeyStroke(MNEMONIC_TOGGLE_CONNECTION);      }      getInputMap().put(ks,MNEMONIC_TOGGLE_CONNECTION);      getActionMap().put(MNEMONIC_TOGGLE_CONNECTION,chgSession );      Action nxtSession = new AbstractAction(MNEMONIC_JUMP_NEXT) {            public void actionPerformed(ActionEvent e) {               nextSession();            }        };      if (!keyMap.isKeyStrokeDefined(MNEMONIC_JUMP_NEXT)) {         ks = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP,KeyEvent.ALT_MASK);      }      else {         ks = keyMap.getKeyStroke(MNEMONIC_JUMP_NEXT);      }      getInputMap().put(ks,MNEMONIC_JUMP_NEXT);      getActionMap().put(MNEMONIC_JUMP_NEXT,nxtSession );      Action prevSession = new AbstractAction(MNEMONIC_JUMP_PREV) {            public void actionPerformed(ActionEvent e) {               prevSession();            }        };      if (!keyMap.isKeyStrokeDefined(MNEMONIC_JUMP_PREV)) {         ks = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN,KeyEvent.ALT_MASK);      }      else {         ks = keyMap.getKeyStroke(MNEMONIC_JUMP_PREV);      }      getInputMap().put(ks,MNEMONIC_JUMP_PREV);      getActionMap().put(MNEMONIC_JUMP_PREV,prevSession );      Action hotSpots = new AbstractAction(MNEMONIC_HOTSPOTS) {            public void actionPerformed(ActionEvent e) {               screen.toggleHotSpots();               System.out.println(MNEMONIC_HOTSPOTS);            }        };      if (!keyMap.isKeyStrokeDefined(MNEMONIC_HOTSPOTS)) {         ks = KeyStroke.getKeyStroke(KeyEvent.VK_S,KeyEvent.ALT_MASK);      }      else {         ks = keyMap.getKeyStroke(MNEMONIC_HOTSPOTS);      }      getInputMap().put(ks,MNEMONIC_HOTSPOTS);      getActionMap().put(MNEMONIC_HOTSPOTS,hotSpots );      Action gui = new AbstractAction(MNEMONIC_GUI) {            public void actionPerformed(ActionEvent e) {               screen.toggleGUIInterface();            }        };      if (!keyMap.isKeyStrokeDefined(MNEMONIC_GUI)) {         ks = KeyStroke.getKeyStroke(KeyEvent.VK_G,KeyEvent.ALT_MASK);      }      else {         ks = keyMap.getKeyStroke(MNEMONIC_GUI);      }      getInputMap().put(ks,MNEMONIC_GUI);      getActionMap().put(MNEMONIC_GUI,gui );      Action msg = new AbstractAction(MNEMONIC_DISP_MESSAGES) {            public void actionPerformed(ActionEvent e) {               vt.systemRequest('4');            }        };      if (!keyMap.isKeyStrokeDefined(MNEMONIC_DISP_MESSAGES)) {         ks = KeyStroke.getKeyStroke(KeyEvent.VK_M,KeyEvent.ALT_MASK);      }      else {         ks = keyMap.getKeyStroke(MNEMONIC_DISP_MESSAGES);      }      getInputMap().put(ks,MNEMONIC_DISP_MESSAGES);      getActionMap().put(MNEMONIC_DISP_MESSAGES,msg );      Action attr = new AbstractAction(MNEMONIC_DISP_ATTRIBUTES) {            public void actionPerformed(ActionEvent e) {               doAttributes();            }        };      if (!keyMap.isKeyStrokeDefined(MNEMONIC_DISP_ATTRIBUTES)) {         ks = KeyStroke.getKeyStroke(KeyEvent.VK_D,KeyEvent.ALT_MASK);      }      else {         ks = keyMap.getKeyStroke(MNEMONIC_DISP_ATTRIBUTES);      }      getInputMap().put(ks,MNEMONIC_DISP_ATTRIBUTES);      getActionMap().put(MNEMONIC_DISP_ATTRIBUTES,attr );      Action print = new AbstractAction(MNEMONIC_PRINT_SCREEN) {            public void actionPerformed(ActionEvent e) {               printMe();            }        };      if (!keyMap.isKeyStrokeDefined(MNEMONIC_PRINT_SCREEN)) {         ks = KeyStroke.getKeyStroke(KeyEvent.VK_P,KeyEvent.ALT_MASK);      }      else {         ks = keyMap.getKeyStroke(MNEMONIC_PRINT_SCREEN);      }      getInputMap().put(ks,MNEMONIC_PRINT_SCREEN);      getActionMap().put(MNEMONIC_PRINT_SCREEN,print );      Action cursor = new AbstractAction(MNEMONIC_CURSOR) {            public void actionPerformed(ActionEvent e) {               screen.crossHair();            }        };      if (!keyMap.isKeyStrokeDefined(MNEMONIC_CURSOR)) {         ks = KeyStroke.getKeyStroke(KeyEvent.VK_L,KeyEvent.ALT_MASK,false);      }      else {         ks = keyMap.getKeyStroke(MNEMONIC_CURSOR);      }      getInputMap().put(ks,MNEMONIC_CURSOR);      getActionMap().put(MNEMONIC_CURSOR,cursor );      Action debug = new AbstractAction(MNEMONIC_DEBUG) {            public void actionPerformed(ActionEvent e) {               vt.toggleDebug();            }        };      if (!keyMap.isKeyStrokeDefined(MNEMONIC_DEBUG)) {         ks = KeyStroke.getKeyStroke(KeyEvent.VK_O,KeyEvent.ALT_MASK);      }      else {         ks = keyMap.getKeyStroke(MNEMONIC_DEBUG);      }      getInputMap().put(ks,MNEMONIC_DEBUG);      getActionMap().put(MNEMONIC_DEBUG,debug );      Action close = new AbstractAction(MNEMONIC_CLOSE) {            public void actionPerformed(ActionEvent e) {               closeSession();            }        };      if (!keyMap.isKeyStrokeDefined(MNEMONIC_CLOSE)) {         ks = KeyStroke.getKeyStroke(KeyEvent.VK_Q,KeyEvent.ALT_MASK);      }      else {         ks = keyMap.getKeyStroke(MNEMONIC_CLOSE);      }      getInputMap().put(ks,MNEMONIC_CLOSE);      getActionMap().put(MNEMONIC_CLOSE,close );      Action transfer = new AbstractAction(MNEMONIC_FILE_TRANSFER) {            public void actionPerformed(ActionEvent e) {               doMeTransfer();            }        };      if (!keyMap.isKeyStrokeDefined(MNEMONIC_FILE_TRANSFER)) {         ks = KeyStroke.getKeyStroke(KeyEvent.VK_T,KeyEvent.ALT_MASK);      }      else {         ks = keyMap.getKeyStroke(MNEMONIC_FILE_TRANSFER);      }      getInputMap().put(ks,MNEMONIC_FILE_TRANSFER);      getActionMap().put(MNEMONIC_FILE_TRANSFER,transfer );      Action e_mail = new AbstractAction(MNEMONIC_E_MAIL) {            public void actionPerformed(ActionEvent e) {               sendScreenEMail();            }        };      if (!keyMap.isKeyStrokeDefined(MNEMONIC_E_MAIL)) {         ks = KeyStroke.getKeyStroke(KeyEvent.VK_E,KeyEvent.ALT_MASK);      }      else {         ks = keyMap.getKeyStroke(MNEMONIC_E_MAIL);      }      getInputMap().put(ks,MNEMONIC_E_MAIL);      getActionMap().put(MNEMONIC_E_MAIL,e_mail );      Action runScript = new AbstractAction(MNEMONIC_RUN_SCRIPT) {            public void actionPerformed(ActionEvent e) {               runScript();            }        };      if (!keyMap.isKeyStrokeDefined(MNEMONIC_RUN_SCRIPT)) {         ks = KeyStroke.getKeyStroke(KeyEvent.VK_R,KeyEvent.ALT_MASK);      }      else {         ks = keyMap.getKeyStroke(MNEMONIC_RUN_SCRIPT);      }      getInputMap().put(ks,MNEMONIC_RUN_SCRIPT);      getActionMap().put(MNEMONIC_RUN_SCRIPT,runScript );      Action spclDump = new AbstractAction("special dump") {            public void actionPerformed(ActionEvent e) {               dumpStuff(new Throwable());            }        };//      if (!keyMap.isKeyStrokeDefined("special dump")) {         ks = KeyStroke.getKeyStroke(KeyEvent.VK_O,KeyEvent.CTRL_MASK | KeyEvent.SHIFT_MASK);//      }//      else {//         ks = keyMap.getKeyStroke(MNEMONIC_RUN_SCRIPT);//      }      getInputMap().put(ks,"special dump");      getActionMap().put("special dump",spclDump );////         Action ohshit = new AbstractAction() {//               public void actionPerformed(ActionEvent e) {//                  System.out.println(e.getActionCommand());//               }//           };//   //         HashMap hm = keyMap.getKeyMap();//   ////   //         Collection v = hm.values();//   //         Set o = hm.keySet();//   //         Iterator k = o.iterator();//   //         Iterator i = v.iterator();//   ////   //         while (k.hasNext()) {//   //            KeyStroker ksr = (KeyStroker)k.next();//   //            String keyVal = (String)i.next();//   //            Action ohshit = new AbstractAction(keyVal) {//   //               public void actionPerformed(ActionEvent e) {//   //                  System.out.println("action command :" + e);//   //               }//   //            };//   //            int mask = 0;//   //            if (ksr.isAltDown())//   //               mask |= KeyEvent.ALT_MASK;//   //            if (ksr.isControlDown())//   //               mask |= KeyEvent.CTRL_MASK;//   //            if (ksr.isShiftDown())//   //               mask |= KeyEvent.SHIFT_MASK;//   //            if (ksr.isAltGrDown())//   //               mask |= KeyEvent.META_MASK;//   ////   //            ohshit.putValue(Action.NAME, keyVal);//   ////   //            ks = KeyStroke.getKeyStroke(ksr.getKeyCode(),mask);//   ////   //            System.out.println(keyVal + " " + ks);//   //            getInputMap().put(ks,keyVal);//   //            getActionMap().put(keyVal,new MyAction(keyVal) );//   ////   //   //         if (keyVal.equals(which)) {//   //   //            mappedKeys.remove(ks);//   //   //            mappedKeys.put(new KeyStroker(ke.getKeyCode(),//   //   //                                          ke.isShiftDown(),//   //   //                                          ke.isControlDown(),//   //   //                                          ke.isAltDown(),//   //   //                                          isAltGr),keyVal);//   //   //            return;//   //   //         }//   //      }   }