Shortcuts "ctrl c" and "ctrl v" don't work on the tree elements, for exemple if i want to copy/paste an HTTP Sample from controller1 to controller2 , i can't do it with the shortcuts.
Additional informations: In MenuFactory.addEditMenu(JPopupMenu menu, boolean removable) with different shortcuts (different from Ctrl+x, Ctrl+c, Ctrl+v), it works fine. I tried with: KeyEvent.VK_(2, 3, 4) (not numpad, watch out they don't behave as normal keys, keyTyped is not call) and with KeyEvent.VK_G (I desactivated this one because it was use elsewhere) (this one behave normally) I added System.out.println and breakpoints in JMeterTreeListener.keyTyped(KeyEvent e) (WARN: I'll provide the System.out.println as a patch but it not for real use) but I don't understand why Ctrl+x doesn't work?! I tried to replace VK_X with VK_CUT, still doesn't work. I read (again and again) the KeyEvent javadoc (http://java.sun.com/j2se/1.5.0/docs/api/java/awt/event/KeyEvent.html), but I didn't see any special mention of a different behavior with those special shortcuts. I tried with azerty and qwerty keyboards, still don't work. The strange thing is that we assign Crtl+x shortcut in MenuFactory.addEditMenu(JPopupMenu menu, boolean removable): menu.add(makeMenuItem(JMeterUtils.getResString("cut"), "Cut", "Cut", KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_MASK))); But in JMeterTreeListener.keyTyped(KeyEvent e): if (e.getKeyChar() == KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_MASK).getKeyChar()) { System.out.println("YES!"); } else { System.out.println("NO!"); } always print "NO!" when typing "Ctrl+x" ?! >java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)
Created attachment 17152 [details] not a real patch just System.out.println do not use in production, it solves nothing.
Created attachment 17153 [details] replace ctrl+(x,c,v) with alt+(x,c,v) A work around is to replace "ctrl" with "alt" replace ctrl+(x,c,v) with alt+(x,c,v) replace alt+x for remote_stop_all with alt+j since alt+x is use for cut now
Created attachment 17158 [details] Simple stand alone java main class that reproduce the same issue I reproduce this bug with a simple stand alone swing component using KeyEventDemo (http://java.sun.com/docs/books/tutorial/uiswing/events/example-1dot4/KeyEventDemo.java) as a base. - run it > type "ctrl+f", "Copy - actionPerformed" is written in the JTextArea - replace VK_F with VK_C > run it > type "ctrl+c", nothing is written in the JTextArea It's a swing issue. I just doesn't work for those special shortcuts... do you plan to use my previous patch (replace ctrl with alt) ?
I opened a sun/java bug. Here's the ref: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6362735
Created attachment 19618 [details] Patch to fix ctrl-c, ctrl-v and ctrl-x Added support for ctrl-c, ctrl-v and ctrl-x to the JMeterTreeListener class. The keypressed event passes to the ActionRouter to perform the task.
Thanks very much - latest patch has been applied to the code
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/1619