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.
There is an issue to provide platform specific shorcuts. The problem is visible on MAC especially. On MAC are actions typically mapped to Meta-<something> instead of Ctrl-<something>. Current implementation of "Shortcuts" folder doesn't allow the platform specific declarations. I guess the main problem of current solution is that the shortcut is encoded into file name in the layer. I.e. current shortcut declaration is like this: <file name="C-X.instance"> <attr name="instanceClass" stringvalue="someAction" /> </file> ----------------------------------- For our purpose we created a hack whic looks like this: <file name="C-X.instance"> <attr name="instanceClass" stringvalue="someAction" /> <attr name="shortcutMAC" stringvalue="M-X"/> </file> The value of attr shortcutMAC is then used instead of the name when running on MAC. But this solution is not 100%, and cannot be applied to NB (When user tries to create the C-X binding, it won't be saved, because the name is already used [and interpretted other way]). ------------------------------------------------ Suggestions to possible solutions. 1) Dont use the shortcut encoding as a file name, rather put the platform specific shortcut encodings as the attributes, there could be used default shortcut too: <file name="someShortcut.instance"> <attr name="instanceClass" stringvalue="someAction" /> <attr name="shortcutDefault" stringvalue="C-X"/> <attr name="shortcutMAC" stringvalue="M-X"/> </file> And then act accordingly to the platform, picking up correct attribute and creating desired binding. This requires to update the handling of the "Shortcuts" folder. 2) Or another solution is to create subfolders with platform specific shortcuts in "Shortcuts" folder. ----------------------- Those are just suggestions, I'd like probably the solution 1). But you can come up certainly with other solutions.
Tim, this is already done, isn't it ?
Should be integrated this week. Peter, quick info: Shortcuts can now be defined as "D-X.instance" (D for Default) which will map to whatever Toolkit.getDefaultToolkit().getMenuShortcutMask() returns. To add/remove shortcuts on a platform-specific basis, provide a module which does this in its layer, and use Openide-Module-Requires in its manifest - there are some per-os pseudo-services that will allow a module to be enabled only on certain platforms. The module should be marked as "eager". See ide/applemenu's manifest for an example. *** This issue has been marked as a duplicate of 46811 ***
Thanks Tim. I think we will basically use the ide/applemenu module, if the stuff is already implemented there.
Cool. Tor mentioned some patch he did for Rave - I haven't looked at it yet. It would be good to know if there are any keybindings I missed - these things are hard to track down, and I haven't been a mac user for so long. Apple has some recommendations, but it doesn't necessarily cover everything.