为了回答我自己的问题,可以使用org.eclipse.ui.bindings扩展点来完全解决这个问题。
首先,像平常一样设置keybinding,然后可以在单个区域设置上取消设置特定的keybinding。仅对于该区域设置,您可以将绑定重新设置为其他内容。
这是可行的,但不幸的是,如果要绑定、取消绑定和重新绑定大量的密钥,那么它会非常冗长。
<!-- set binding globally -->
<key
commandId="com.foo.myCommandId"
contextId="org.eclipse.ui.contexts.window"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="M3+G T"/>
<!-- un-set binding for Swiss German -->
<key
commandId="com.foo.myCommandId"
contextId="org.eclipse.ui.contexts.window"
locale="de_CH"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="M3+G C"/>
<!-- re-set binding for Swiss German with a new key combo -->
<key
commandId="com.foo.myCommandId"
contextId="org.eclipse.ui.contexts.window"
locale="de_CH"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="M1+M3+G C"/>