[Bindings] Removing a key-binding [message #654605] |
Wed, 16 February 2011 08:31  |
Eclipse User |
|
|
|
Actually, redefining a key binding is easy by providing a ney key
extension for the extension point org.eclipse.ui.bindings. Now I have
the following problem: Sometimes a pre-defined key-binding is just ugly,
e.g. I consider the pre-defined key-binding for the CollapseAll handler
as "ugly", "M1+M2+NUMPAD_DIVIDE" is just a mess. In this case it would
be ideal for us, if this Handler would not provide *any* key-binding at
all. But according to the extension point definition
org.eclipse.ui.bindings#key the value is required. Does there exist an
officially supported mechanism to remove a key-binding or replacing it
my something that corresponds to 'no-binding-at-all' magic?
Thanks & Greetings from Bremen,
Daniel Krügler
|
|
|
|
Re: [Bindings] Removing a key-binding [message #654800 is a reply to message #654712] |
Thu, 17 February 2011 03:41   |
Eclipse User |
|
|
|
On 2011-02-16 19:54, Paul Webster wrote:
> You cannot mark a command that way, but you can delete a specific
> keybinding in a specific context:
>
> copy out the Collapse All keybinding, and simply remove the commandId
> ... that will wipe out that binding.
OK, that worked, thanks!
> But with a delete marker at the same level provided by a plugin.xml
> (considered SYSTEM) only users would be able to bind that key sequence
> to something more useful (with a few minor exceptions)
I have problems to follow you here, could you elaborate, please?
1) Is the "delete marker" the above mentioned keybinding registration
that omits the commandId?
2) I don't understand, in which sense "SYSTEM" and "users" are entering
the game here.
Do you want to describe that by doing above effective removal of the
key-binding "M1+M2+NUMPAD_DIVIDE" I can never reassign this binding to
another command?
Thanks & Greetings from Bremen,
- Daniel Krügler
|
|
|
|
Re: [Bindings] Removing a key-binding [message #654908 is a reply to message #654884] |
Thu, 17 February 2011 09:52  |
Eclipse User |
|
|
|
On 2011-02-17 14:57, Paul Webster wrote:
> On 02/17/2011 03:41 AM, Daniel Krügler wrote:
>> 1) Is the "delete marker" the above mentioned keybinding registration
>> that omits the commandId?
>
> yes
>
>> 2) I don't understand, in which sense "SYSTEM" and "users" are entering
>> the game here.
>
> Anything that comes in through plugin.xml is SYSTEM. Anything changed in
> the keys preference page is USER.
>
OK, I understand - even though I never have looked at it with such roles
in my mind.
>> Do you want to describe that by doing above effective removal of the
>> key-binding "M1+M2+NUMPAD_DIVIDE" I can never reassign this binding to
>> another command?
>
> right now you have:
>
> binding1: M1+M2+NUMPAD_DIVIDE collapseAll org.eclipse.ui.contexts.window
> org.eclipse.ui.defaultAcceleratorConfiguration SYSTEM
>
> binding2: M1+M2+NUMPAD_DIVIDE <delete-no-id>
> org.eclipse.ui.contexts.window
> org.eclipse.ui.defaultAcceleratorConfiguration SYSTEM
>
>
> binding2 will delete any bindings that match the other attributes (same
> scheme, same context, same key sequence, etc).
>
> It just means that you can't re-assign it in your plugin.xml to another
> command in org.eclipse.ui.contexts.window
> org.eclipse.ui.defaultAcceleratorConfiguration
Thanks for your thorough explanation, Paul - it was very helpful.
- Daniel
|
|
|
Powered by
FUDForum. Page generated in 0.28824 seconds