netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Tweak some keyboard behaviors in various platform components

Open eirikbakke opened this issue 8 months ago • 1 comments
trafficstars

Here are a couple of smaller improvements, relating to keyboard shortcuts in various platform components. I have left each improvement as a separate commit since they are technically unrelated:

  • Make the accelerators for MoveWindowLeftAction/MoveWindowRightAction show up properly in the context menu that shows up when you right-click an editor tab.
    • image
  • On MacOS, add Command+O as a shortcut for Open (default action) in TreeView (Projects, Files tabs etc.), like in Finder.
  • In TreeView and OutlineView, improve the position of the context menu when opened via the keyboard accelerator (Shift+F10).
    • Before: image
    • After: image
  • Make F2 to rename work on MacOS on TreeTable/TreeView/ETable. (It already works on Windows.)

eirikbakke avatar Mar 12 '25 16:03 eirikbakke

@matthiasblaesing Thanks for reviewing!

I missed the "Go to Type" mapping... in fact Command+O does map to "Go to Type" on MacOS.

I can remove that part of the PR. Or, I can alternatively keep the current behavior, which is that Command+O will open a file if keyboard focus is in the Projects or Files sidebars, while invoking the global shortcut (Go to Type) if keyboard focus is e.g. in the editor area.

eirikbakke avatar Jun 12 '25 21:06 eirikbakke

I think it would be good to keep Command+O bound as is to keep it consistent between platform. I understand, that that is the case with this PR, so I think it would be good to get this in soon.

matthiasblaesing avatar Aug 14 '25 18:08 matthiasblaesing

As in, merge the PR as it is, without changes?

(Sorry, my confusion...)

eirikbakke avatar Aug 15 '25 01:08 eirikbakke

I meant, that I think it is good that an application tries to be consistent in itself. I.e. the application works similar on all platforms. As Command and CTRL are filling the same role on mac OS and Windows/Linux, I think the established NB internal mappings should take precedence. My understanding of

I missed the "Go to Type" mapping... in fact Command+O does map to "Go to Type" on MacOS.

was that Command+O is still bound to "Go to Type", if that is not the case, I think, that that should be removed.

matthiasblaesing avatar Aug 16 '25 17:08 matthiasblaesing

was that Command+O is still bound to "Go to Type", if that is not the case, I think, that that should be removed.

Command+O is still bound to "Go to Type", except if the keyboard focus is in the Projects or Files sidebars. In that case it would behave like in Finder on MacOS.

But I can just remove the Command+O commit, so the shortcut doesn't end up have two different meanings within the same app.

eirikbakke avatar Aug 18 '25 19:08 eirikbakke

But I can just remove the Command+O commit, so the shortcut doesn't end up have two different meanings within the same app.

Yes, I think that would be better.

matthiasblaesing avatar Aug 21 '25 15:08 matthiasblaesing

OK, I removed the Command+O commit with no other changes, and rebased. Will wait for tests to pass, then merge. Thanks for reviewing!

eirikbakke avatar Aug 21 '25 16:08 eirikbakke