1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 18:56:02 +02:00

Terminal: Bug 434939 - Keybinding conflicts when installing into JEE

The "Alt+V" key binding reported an error when installed into the
Eclipse JEE package. This is resolved by making our TerminalContext
a child of the Eclipse Window context.

At the same time, provide better human-readable labels for the Terminal
Edit Context (menu on Terminal Widget) and Terminal Typing Context.
And, register more Alt+Char key bindings after carefully reviewing
existing Eclipse Main Menus, shortcuts and expected readline support.

Change-Id: I91c932cce428f7a7a3fa829d7776baa135474330
Signed-off-by: Martin Oberhuber <martin.oberhuber@windriver.com>
This commit is contained in:
Martin Oberhuber 2014-05-16 23:59:02 +02:00
parent 5353f9f71d
commit cc68394674
3 changed files with 46 additions and 8 deletions

View file

@ -21,8 +21,11 @@
pluginName = Target Management Terminal Widget pluginName = Target Management Terminal Widget
providerName = Eclipse TM Project providerName = Eclipse TM Project
terminal.context.name=Terminal widget context terminal.context.name.edit=Terminal Widget in Focus
terminal.context.description=Override ALT+x menu access keys terminal.context.description.edit=Show modified keyboard shortcuts in context menu
terminal.context.name.terminal=Terminal Typing Connected
terminal.context.description.terminal=Override ALT+x menu access keys while typing into the Terminal
terminal.insertion.description=Terminal view insertion terminal.insertion.description=Terminal view insertion
terminal.insertion.name=Terminal view insert terminal.insertion.name=Terminal view insert

View file

@ -14,18 +14,20 @@
# Martin Oberhuber (Wind River) - [378691][api] push Preferences into the Widget # Martin Oberhuber (Wind River) - [378691][api] push Preferences into the Widget
# Martin Oberhuber (Wind River) - [434294] Add Mac bindings with COMMAND # Martin Oberhuber (Wind River) - [434294] Add Mac bindings with COMMAND
# Martin Oberhuber (Wind River) - [434487] Add key bindings for "maximize view" and "quick access" # Martin Oberhuber (Wind River) - [434487] Add key bindings for "maximize view" and "quick access"
# Martin Oberhuber (Wind River) - [434939] Fix Keybinding conflicts with JEE Luna package
--> -->
<plugin> <plugin>
<extension-point id="terminalConnectors" name="Terminal Connectors" schema="schema/terminalConnectors.exsd"/> <extension-point id="terminalConnectors" name="Terminal Connectors" schema="schema/terminalConnectors.exsd"/>
<extension point="org.eclipse.ui.contexts"> <extension point="org.eclipse.ui.contexts">
<context <context
name="%terminal.context.name" name="%terminal.context.name.terminal"
description="%terminal.context.description" description="%terminal.context.description.terminal"
parentId="org.eclipse.ui.contexts.window"
id="org.eclipse.tm.terminal.TerminalContext" id="org.eclipse.tm.terminal.TerminalContext"
/> />
<context <context
name="%terminal.context.name" name="%terminal.context.name.edit"
description="%terminal.context.description" description="%terminal.context.description.edit"
parentId="org.eclipse.ui.contexts.window" parentId="org.eclipse.ui.contexts.window"
id="org.eclipse.tm.terminal.EditContext" /> id="org.eclipse.tm.terminal.EditContext" />
</extension> </extension>
@ -72,6 +74,21 @@
contextId="org.eclipse.tm.terminal.TerminalContext" contextId="org.eclipse.tm.terminal.TerminalContext"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="Alt+A"/> <!-- Search --> sequence="Alt+A"/> <!-- Search -->
<key
commandId="org.eclipse.tm.terminal.command1"
contextId="org.eclipse.tm.terminal.TerminalContext"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="Alt+B"/> <!-- Readline word-left: just to be safe -->
<key
commandId="org.eclipse.tm.terminal.command1"
contextId="org.eclipse.tm.terminal.TerminalContext"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="Alt+C"/> <!-- ClearCase, Extract Constant -->
<key
commandId="org.eclipse.tm.terminal.command1"
contextId="org.eclipse.tm.terminal.TerminalContext"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="Alt+D"/> <!-- Design, Diagram, Debug -->
<key <key
commandId="org.eclipse.tm.terminal.command1" commandId="org.eclipse.tm.terminal.command1"
contextId="org.eclipse.tm.terminal.TerminalContext" contextId="org.eclipse.tm.terminal.TerminalContext"
@ -86,12 +103,17 @@
commandId="org.eclipse.tm.terminal.command1" commandId="org.eclipse.tm.terminal.command1"
contextId="org.eclipse.tm.terminal.TerminalContext" contextId="org.eclipse.tm.terminal.TerminalContext"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="Alt+G"/> sequence="Alt+G"/> <!-- Tar&get -->
<key <key
commandId="org.eclipse.tm.terminal.command1" commandId="org.eclipse.tm.terminal.command1"
contextId="org.eclipse.tm.terminal.TerminalContext" contextId="org.eclipse.tm.terminal.TerminalContext"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="Alt+H"/> <!-- Help --> sequence="Alt+H"/> <!-- Help -->
<key
commandId="org.eclipse.tm.terminal.command1"
contextId="org.eclipse.tm.terminal.TerminalContext"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="Alt+L"/> <!-- Ana&lyze -->
<key <key
commandId="org.eclipse.tm.terminal.command1" commandId="org.eclipse.tm.terminal.command1"
contextId="org.eclipse.tm.terminal.TerminalContext" contextId="org.eclipse.tm.terminal.TerminalContext"
@ -101,7 +123,7 @@
commandId="org.eclipse.tm.terminal.command1" commandId="org.eclipse.tm.terminal.command1"
contextId="org.eclipse.tm.terminal.TerminalContext" contextId="org.eclipse.tm.terminal.TerminalContext"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="Alt+P"/> <!-- Project --> sequence="Alt+P"/> <!-- Project, Papyrus, Ping -->
<key <key
commandId="org.eclipse.tm.terminal.command1" commandId="org.eclipse.tm.terminal.command1"
contextId="org.eclipse.tm.terminal.TerminalContext" contextId="org.eclipse.tm.terminal.TerminalContext"
@ -127,6 +149,11 @@
contextId="org.eclipse.tm.terminal.TerminalContext" contextId="org.eclipse.tm.terminal.TerminalContext"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="Alt+W"/> <!-- Window --> sequence="Alt+W"/> <!-- Window -->
<key
commandId="org.eclipse.tm.terminal.command1"
contextId="org.eclipse.tm.terminal.TerminalContext"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="Alt+Y"/> <!-- S&ystem -->
<!-- <!--
For Copy and Paste, we need replacements since the default Ctrl+C / Ctrl+V For Copy and Paste, we need replacements since the default Ctrl+C / Ctrl+V
need to go to the terminal and thus are not available for local Copy and Paste. need to go to the terminal and thus are not available for local Copy and Paste.

View file

@ -872,9 +872,14 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
protected class TerminalKeyHandler extends KeyAdapter { protected class TerminalKeyHandler extends KeyAdapter {
public void keyPressed(KeyEvent event) { public void keyPressed(KeyEvent event) {
//TODO next 2 lines are probably obsolete now
if (getState()==TerminalState.CONNECTING) if (getState()==TerminalState.CONNECTING)
return; return;
//TODO we should no longer handle copy & paste specially.
//Instead, we should have Ctrl+Shift always go to local since there is no escape sequence for this.
//On Mac, Command+Anything already goes always to local.
//Note that this decision means that Command will NOT be Meta in Emacs on a Remote.
int accelerator = SWTKeySupport.convertEventToUnmodifiedAccelerator(event); int accelerator = SWTKeySupport.convertEventToUnmodifiedAccelerator(event);
if (editActionAccelerators.isCopyAction(accelerator)) { if (editActionAccelerators.isCopyAction(accelerator)) {
copy(); copy();
@ -1094,6 +1099,9 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
character = '\u0000'; character = '\u0000';
} }
//TODO: At this point, Ctrl+M sends the same as Ctrl+Shift+M .
//This is undesired. Fixing this here might make the special Ctrl+Shift+C
//handling unnecessary further up.
sendChar(character, altKeyPressed); sendChar(character, altKeyPressed);
// Special case: When we are in a TCP connection and echoing characters // Special case: When we are in a TCP connection and echoing characters