The "duplicate lines up/down" shortcuts are mapped to SHIFT-COMMAND-UP/DOWN on OS X. COMMAND-UP/DOWN and SHIFT-COMMAND-UP/DOWN are standard/reserved OS X shortcuts for navigating to the top/bottom of a document. This leads to very unexpected (and destructive behavior).
Additional issues: On OS X the HOME/END/PAGE_UP/PAGE_DOWN commands move the view but *not* the cursor position (similar to clicking on the scroll bar), so they aren't appropriate shortcuts for Netbeans. The correct shortcuts to handle these tasks should be added (keeping the current incorrect shortcuts as alternatives to avoid confusing newbies):
Insertion Point to Beginning of Document: META+UP
Insertion Point to End of Document: META+DOWN
Extend Selection to Beginning of Document: SHIFT+META+UP
Extend Selection to End of Document: SHIFT+META+DOWN
Page Up: ALT+PAGE_UP
Page Down: ALT+PAGE_DOWN
Extend Selection to Previous Page: SHIFT+ALT+PAGE_UP
Extend Selection to Next Page: SHIFT+ALT+PAGE_DOWN
And suggestions for the commands from the description (the original shortcuts should be removed):
Duplicate Line(s) Up: ALT+META+UP
Duplicate Line(s) Up: ALT+META+DOWN
META = COMMAND
Whoops--the first two in the list are already correct.
Strangely neither Eclipse or IntelliJ seem to bother to conform to Mac nonstandard keyboard mappings (even though IntelliJ has a special MacOS 10.5+ key map)
I imagine it's because they're not mac users, and most people can't seem to overcome the confusion generated by having keys with the same name doing something completely different (home/end), and the concept that keyboard shortcuts don't necessarily have to affect cursor position.
These are all *standard* OSX mappings.
Although the mappings may be OS-X standard, the are not standard in the target software segment; at least 3 major players (NB, IntelliJ, Eclipse) do not conform to Apple scheme, possibly for a good reason.
Since the request seems to remap core keys used consistently in code editing application on various OSes (excluding MacOS, which is special) it should be reviewed for potential usability issues.
We cannot blindly conform to whatever scheme if the impact on the current or prospective users would be negative in terms of either productivity or expected behaviour.
BTW - even if the request will be rejected (which I do not know at this point) you are free to contribute a plugin that rebinds the editor movement keys exactly according to Apple standards.
Reassigning for usability impact evaluation.
As I mentioned, you can (and should) keep the current key combinations as alternatives, so there shouldn't be any usability issues. However, as mentioned in the description COMMAND-SHIFT-UP/DOWN are *the* OS X shortcuts for navigating to the top/bottom of a file (with selection). Something so basic and common should not be mapped to something else in Netbeans, and certainly not to something destructive.
As for the "what the other IDEs do argument", I use Eclipse and IntelliJ. Eclipse does this key combination properly, and as any mac user can tell you IntelliJ's OS X keymaps are a joke. In neither case is it mapped to anything other than for navigation.
And seriously, since when is "the other guys do it wrong, so we should do it wrong too" a valid argument?
The goal is to make the IDE more usable. Not only for native MacOS X application users, but also for 'immigrants' from other IDEs, and for people who develop on multiple platforms and not necessarily use Mac as their primary OS.
As I am not that skilled in balancing those criteria, so I've asked for expertise. I suggest to wait for the outcome; although having collected a list of supporting arguments from one of the affected user groups is a plus.
Isn't there a separate keymap for OS X (rhetorical question--the answer is "yes")? Adding the correct keys for OS X won't affect anyone else.
And once again, I agree--that's why the current mappings should be kept as alternatives. I'm using the terminology used in the IDE itself--"alternative" means alternate key mapping. That is, the current key combinations will still work in addition to the new ones. The only exception is the one first mentioned in this report, which is a recent addition and already isn't where people who use different platforms would expect to find it, since obviously other platforms don't have a COMMAND key.
Just to be sure: what is 'home' on the apple keyboard ? I borrowed MacBook Pro, and the closest to 'Home' key (which does not exist) is Fn+LEFT, Fn+RIGHT for 'End' - but their function in XCode or TextEdit is a way different (scroll view one page up/down). Actually I can't find a key for 'start of the line' function :)
Could you list, preferrably in a table, bindings for [all] navigational actions, according to Mac standards ? I need to find clashes of mac-native shortcuts with other actions and possibly remap the affected actions to different shortcuts for MacOS X.
Yep, FN-LEFT/RIGHT is the HOME/END equivalent (that is, Apple's version of these keys). Actually, the HOME/END keys scroll the *view but not the cursor* to the top/bottom of the document, as if you dragged the scroll bar widget to the top/bottom. PAGE UP/PAGE DOWN works similarly except they move the view one page at a time. Since on OSX these commands don't move the cursor, they're not technically the right commands Netbeans should be using (AFAIK Netbeans does not have an equivalent command for them). You're right that these keys should be kept in the default profile to make things easier on those more familiar with the Windows/Unix/Everyone Else way. Just add the technically correct keys as well. The more rabid OSX purists will complain that they don't want their environment polluted with Windows cruft, so maybe make a new "OSX Purist" profile as well.
Created attachment 133775 [details]
OS X Shortcuts
Created attachment 133776 [details]
OS X Shortcuts
As you noted, I cannot find relevant action for only scrolling except
"scroll [line] up/down", but those are not defined on the mac on the other hand.
I added META-Left/Right, moved 'duplicate lines' to ALT-SHIFT-up/down, restoring original OSX behaviour for Shift-META-up/down.
Fixed in http://hg.netbeans.org/jet-main/rev/60679413638f
Integrated into 'main-golden', will be available in build *201305102300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Svata Dedic <email@example.com>
Log: #228315: remapped conflicting shortcuts
Works fine, thanks! But sorry, I overlooked a couple of other issues. Do you want me to verify this issue and create a new one, leave this one as resolved pending those issues, or reopen?
Control-up/down/left/right and shift-control-up/down are also OS X reserved shortcuts dealing with workspace management. This affects:
- scroll up/down (control-up/down)
- back/forward (ctrl-left/right)--does this work on Windows either since that's next/previous word?
This shortcut has a conflict but it works since it has an alternate. However, the alternate (option-up/down) technically conflicts with the OS X shortcut for paragraph up/down (which I failed to put on that shortcut list--sorry):
- navigate to previous/next occurrence (also control-up/down)
Should I verify this and open a new bug for the conflicts mentioned in comment #17, or just keep this one open?
(In reply to comment #18)
> Should I verify this and open a new bug for the conflicts mentioned in comment
> #17, or just keep this one open?
I would recommend to create a new bugzilla issue(s) for the remaining problems (while keeping all related issues linked through dependencies), not to over-complicate this particular one. It is better to keep issues focused as narrowly as possible and not to change their scope during commenting discussion - that makes later orientation more difficult and may prevent new users from discovering that a particular problem has already been filed. Thanks, Peter
*** Bug 230029 has been marked as a duplicate of this bug. ***