This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | alt keybindings are completly broken on MAC | ||
---|---|---|---|
Product: | editor | Reporter: | Pavel Rehak <prehak> |
Component: | Key bindings | Assignee: | Jan Jancura <jjancura> |
Status: | RESOLVED INVALID | ||
Severity: | blocker | CC: | juhrik, tboudreau |
Priority: | P2 | Keywords: | RELNOTE |
Version: | 6.x | ||
Hardware: | All | ||
OS: | Mac OS X | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 60567, 76998 | ||
Attachments: | Messages.log attached |
Description
Pavel Rehak
2006-05-31 09:26:30 UTC
*** Issue 77127 has been marked as a duplicate of this issue. *** Changing version to 5.0 because of the duplicate issue FYI, absolutely no keybindings should be bound to Alt on Macintosh - it is the compose character for many international keyboards. Here is how it should work: - Anything that is Ctrl-Something on PC should be Command (META) -Something on mac - Anything that is Alt-Something on PC should be Ctrl-something on mac For declarative keybindings, the logic is already in Utilities.keyToString(), etc. to do this transparently - just declare your Ctrl (on PC) keybindings using "D" instead of "C" to indicate Ctrl, and it will automagically map to Command on Mac and Ctrl everywhere else. And similarly, instead of using "A" for Alt, use "O" and it will automagically be Ctrl on Macintosh and Command everywhere else. The algorithm in Utilities.keyToString() is smart enough to recognize the few Command- bindings that are consumed by Mac OS (Command-H, Command-Q, Command-Space), and not remap those from Command to Ctrl. Example: CA-R defines a keybinding as Ctrl-Alt-R on all platforms DO-R defines a keybinding as Ctrl-Alt-R on non-Macintosh, and Command-Ctrl-R on Macintosh. So this should be relatively simple to fix everywhere. Yes, please fix in 5.5. Whenever you want completion of arguments, you have to insert the character for PI into your source code on mac :-/ The keybindings used to be handled through Utilities.keyToString(). I was supposed that the new options retained this. Hanzi, please fix this, you are the most eligible person for this ;) Thanks. *** Issue 82511 has been marked as a duplicate of this issue. *** It's getting pretty late to fix this for 5.5 and it makes basic NetBeans features unusable on the mac. We should *really* fix this. Status? I've checked the NetBeans-keybindings.xml in the editor and also DefaultKeyBindings.xml in the java/editor and they both seem to contain the right prefixes e.g. goto-declaration is O-G etc. I've checked both trunk and release55 and the files are the same. I've checked with Tomasz Slota on Mac OS X with 5.5 build and the goto-declaration works with Ctrl-Shift-G. Tim could you please double-check on your machine and reopen if it's still not working? Thanks. NetBeans IDE Dev (Build 200610171800) 1.5.0_06; Java HotSpot(TM) Client VM 1.5.0_06-64 Mac OS X version 10.4.8 running on ppc en_US (nb); MacRoman Since 77127 is a duplicate of this issue this one is not fixed. It prints π to editor instead of offering method parameters when Alt+P is pressed. So what is the magic keyboard shortcut offering method parameters on Mac OS (ALT+P equivalent for Mac)? Command+Shift+Right and Command+Shift+Left are not working either (or what shortcut to use instead of it on Mac?). If you mean select previous/next word, on Mac OS that *should* be Alt-Shift-Arrow so that it is consistent with native mac apps (Command left/right should be the same as home/end on a pc). Tim, you are right that Cmd+Left and Cmd+Right move correctly cursor to the End/Begin of the line. But how can I easily select the line? Sequence Cmd+Left followed by Cmd+Shift+Right doesn't select the line. This is common behavior that should work as in other Mac OS tools. I believe that this is now fixed. Please also see issue #60835. I've add a warning message to the parser of keybinding definitions which alerts modules when their keybindings are not Mac-friendly. This issue seems to be fixed just partially. Hitting alt g, alt p, alt o .. still writes to editor some internationalized character - there should be added some default keybinding that is working on Mac. The positive for me is that Cmd+Shift+Left/Command+Shift+Right selects line to the begin/end and works perfectly now. According to the first part of my comment I am reopening this issue. I am going to attach the messages.log that shows some warnings related to keymaps. Created attachment 36510 [details]
Messages.log attached
Jaro, wait a second, of course Alt+something will generate an international character on Mac. The shortcuts (eg. for tooltip-show action) are defined with 'O-' at the beginning, which means that the platform specific alternate accelerator will be used. In case of Mac that would be the Ctrl key. So for showing a tooltip you should press Ctrl+P on Mac and Alt+P on PC. Is this working? Here is how the shortcuts are defined currently (action:shortcut:keys-Mac:keys-PC): tooltip-show : O-P : Ctrl+P : Alt+P goto-source : O-O : Ctrl+O : Alt+O goto-declaration : OS-G/O-G : Ctrl+Shift+G : Alt+G The shortcut for the goto-declaration action is different for Mac and PC for some reason, but should still work. Could you please check that again? Thanks. Goto declaration might different because on all Mac OS text editor apps because Command-G, not Ctrl-H as on windows, is bound to Find Next. Actually that shoulnd't be a problem - Ctrl-G would work (but you actually want to hard-bind that to CTRL on mac so you don't clobber Find Next). BTW, has anyone checked the new code completion (smart, etc.) shortcuts on Mac? If you have multiple locales you switch between, Command-Space switches between them (why we keep code completion itself as Ctrl-Space even on mac). I am marking this issue as VERIFIED. I have checked shortcuts in following build: NetBeans IDE Dev (Build 200703181900) 1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-87 Mac OS X version 10.4.8 running on i386 en_US (nb); MacRoman This problem still exists with NB6.0 beta 1. Please fix - it makes emacs keybindings extremely cumbersome on the Mac, whereas they work fine on Linux / Solaris. I am sorry, sangudo, but could you please open a new defect and be more specific about what exactly does not work. This issue is too confusing to know what needs fixing. Well, if there are any keybindings bound to Alt on mac, that is a bug by itself. Are there any? No, none. Certainly not in the Emacs profile. less ide/defaults/src/org/netbeans/modules/defaults/Emacs-keybindings.xml less ide/defaults/src/org/netbeans/modules/defaults/Emacs-keybindings-mac.xml |