Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Overriding key bindings for editing text
Overriding key bindings for editing text [message #1039960] Fri, 12 April 2013 21:40 Go to next message
Thomas Wheeler is currently offline Thomas WheelerFriend
Messages: 2
Registered: April 2013
Junior Member
I'm trying to create custom key bindings for text editors (Juno and Kepler). After a bit of experimenting I still don't understand what Eclipse is doing.

Here are the bindings I want:

Line Down -> Ctrl+B
Line Up -> Ctrl+G
Line Begin -> Ctrl+R
Line End -> Ctrl+T

1. Apparently Ctrl+T is bound to "Quick Hierarchy" when Editing Java Source. However, none of the bindings for Ctrl+T that I can find are for "Editing Java Source". If I filter on "Quick Hierarchy" I see the command, but there is no binding or context. How do I find the Ctrl+T binding for Editing Java Source?

2. Defining a second override for Ctrl+T, for Editing Java Source, worked.

3. I'm unable to find an override for Ctrl+T that works when editing an Ant file. I see the same behavior when trying to rebind Ctrl+G and Ctrl+B bindings. I also tried overriding both Editing Ant Buildfiles and Editing XML Source, with no success.

4. The same bindings work fine when editing context.xml.

I suspect my mental model of how bindings should work is badly broken. It "seems" like an override for Editing Text should apply to all text editors regardless of the type of file open in the editor. Obviously that isn't the case, but I can't construct a coherent mental model that explains what it's doing in these four separate cases. My solution at the moment is "try overriding in a context that seems to apply, and if that doesn't work add more overrides to other contexts in hopes that you get lucky".

To end with a specific questions, is there a way to get a binding for Edit Text to work for all editors, regardless of file type? (I.e. override all contexts.)

Re: Overriding key bindings for editing text [message #1042507 is a reply to message #1039960] Tue, 16 April 2013 14:09 Go to previous message
Thomas Wheeler is currently offline Thomas WheelerFriend
Messages: 2
Registered: April 2013
Junior Member
500 reads and no responses...did I ask this in the wrong forum? Apologies if so, and please direct me to the right place to ask this if so.

EDIT: Well maybe it's just the forum, I see other posts that have a lot of views and no reply either. I'll go root around in the source and see if I can figure this out.

[Updated on: Tue, 16 April 2013 14:12]

Report message to a moderator

Previous Topic:register IResourceChangeListener
Next Topic:Forcing p2 update
Goto Forum:

Current Time: Fri May 25 16:59:26 GMT 2018

Powered by FUDForum. Page generated in 0.01938 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top