From 5afca1ae7099f34baf42e1d398a49ac93d665a96 Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Fri, 9 May 2014 15:13:10 +0200 Subject: [PATCH] Terminal: Bug 434294 Fix handling of multiple key bindings for copy/paste - now considering all key bindings in EditActionsAccelerator - fix incorrect creation of escape codes for a combination of modifiers Change-Id: I2547bba7ef3ca13370b1abf3f8ad8f5956d76c58 Signed-off-by: Anton Leherbauer --- .../emulator/EditActionAccelerators.java | 32 ++++++++----------- .../emulator/VT100TerminalControl.java | 31 ++++++++++-------- 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/EditActionAccelerators.java b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/EditActionAccelerators.java index 2fd6b68d4ed..0286fd4f807 100644 --- a/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/EditActionAccelerators.java +++ b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/EditActionAccelerators.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013 Wind River Systems, Inc. and others. + * Copyright (c) 2013, 2014 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -19,8 +19,8 @@ import org.eclipse.ui.PlatformUI; import org.eclipse.ui.keys.IBindingService; class EditActionAccelerators { - private static final String COPY_COMMAND_ID = "org.eclipse.tm.terminal.copy"; - private static final String PASTE_COMMAND_ID = "org.eclipse.tm.terminal.paste"; + private static final String COPY_COMMAND_ID = "org.eclipse.tm.terminal.copy"; //$NON-NLS-1$ + private static final String PASTE_COMMAND_ID = "org.eclipse.tm.terminal.paste"; //$NON-NLS-1$ private final Map commandIdsByAccelerator = new HashMap(); @@ -30,25 +30,21 @@ class EditActionAccelerators { } private void addAccelerator(String commandId) { - KeySequence keySequence = bindingFor(commandId); - if (keySequence == null) { - return; - } - KeyStroke[] keyStrokes = keySequence.getKeyStrokes(); - if (keyStrokes.length != 0) { - int accelerator = SWTKeySupport.convertKeyStrokeToAccelerator(keyStrokes[0]); - commandIdsByAccelerator.put(new Integer(accelerator), commandId); + TriggerSequence[] bindings = bindingsFor(commandId); + for (int i=0; i