Friday 27 September 2013

Move focus to next window conflict with eclipse on OSX

Move focus to next window conflict with eclipse on OSX

I'm trying to get eclipse (Kepler, but it shouldn't matter because all
versions I've used seem to have this problem) to play well with OSX and
the 'Move focus to next window' keybinding.
OSX has a keybinding for moving between windows within an application - by
default this is bound to CMD-`. I'd like to use this in eclipse for the
Next Editor/Previous Editor navigation to be consistent with switching
between documents in other OSX applications.
Here's the problem: If I have 'Move focus to next window' enabled in
System Preferences (System Preferences::Keyboard::Keyboard
Shortcuts::Keyboard & Text Input::Move focus to next window), then eclipse
doesn't seem to receive the key events for this - it sort of seems like
OSX is intercepting the events before eclipse gets them. If I disable
'Move focus to next window', then I can successfully bind CMD-to 'Next
Editor' in eclipse. But then none of my other OSX applications can use
CMD- which isn't really what I want.
An alternative, I thought, was to actually define a system-level keyboard
shortcut (System Preferences::Keyboard::Keyboard Shortcuts::Application
Shortcuts) for just eclipse - binding Cmd-to 'Next Editor'. That *kind of*
works, but not really. In that case I can still use Cmd- in other
applications, and I can use Cmd-` to bring up the document switch window
in Eclipse, but then like a lot of java apps, when the document switch
dialog window pops up most of the menu items in the system menu bar
disappear - including the 'Next Editor' entry. That seems to prevent OSX
from switching further down in the document stack in Eclipse. So basically
I can switch between the 2 most recent documents, but nothing else!
Can anyone think of a better solution? Maybe an edit to the eclipse source
that I can make to properly intercept Cmd-`?

No comments:

Post a Comment