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.

Bug 110492 - Custom keybinding profiles use non-portable accelerator definitions
Summary: Custom keybinding profiles use non-portable accelerator definitions
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Key bindings (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Max Sauer
URL:
Keywords:
Depends on:
Blocks: 152193
  Show dependency tree
 
Reported: 2007-07-21 09:02 UTC by _ tboudreau
Modified: 2009-02-19 20:45 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2007-07-21 09:02:21 UTC
If I generate a custom keybinding profile on the Mac, all keybindings are hard-coded to Meta.  I now have keybinding profile export-as-nbm in contrib/
EditorThemeSuite/export, but of course exporting such a non-portable profile is fairly useless.

It should be perfectly safe to generate portable keybinding definitions for these files (D for Meta on Mac/Ctrl on PC, O for Ctrl on Mac, Alt on PC).
Comment 1 Vitezslav Stejskal 2007-07-25 13:26:14 UTC
The keybindings storage uses Utilities.keyToString(KeyStroke).
Comment 2 _ tboudreau 2007-09-14 14:01:41 UTC
Probably we need a keyToString() variant that produces portable keybindings by default;  I suspect we will still need the non-portable ones in some places.
Comment 3 Jaroslav Tulach 2007-09-19 15:27:18 UTC
Feel free[1] to add keyToString(KeyStroke ks, boolean portable) if you need it. Or fix this problem in editor/options 
some different way.

[1] With a one line test.
Comment 4 Max Sauer 2009-01-08 12:24:06 UTC
I've added the method to Utilities API (with a five-line test ;) and modified editor.settings.storage and keymap.options export functionality to use it. Marking 
as FIXED.
---
http://hg.netbeans.org/main/rev/f37cf26e5b49
Comment 5 Quality Engineering 2009-01-09 16:48:45 UTC
Integrated into 'main-golden', will be available in build *200901091401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/f37cf26e5b49
User: Max Sauer <msauer@netbeans.org>
Log: #110492: Custom keybinding profiles use non-portable accelerator definitions
Comment 6 _ tboudreau 2009-01-13 00:11:04 UTC
So, new keybinding profiles will be portable, but if you imported settings from an old version of NetBeans, the
keybindings will be non-portable, is that correct?  
Comment 7 Max Sauer 2009-01-13 09:35:50 UTC
Currently:
--------
- profiles are stored in portable form if possible (if you are on mac, keybindings containing alt have to be hardcoded)
- keybindings exported through options/keybindings/manage profiles are stored in the same way
- in case you will use keybindings from an older NB version and copy/import them inside userdir, hardcoded values will be used.
Comment 8 Max Sauer 2009-01-13 09:46:11 UTC
One more thing: If you export the old (imported from earlier version) profile through 'Manage profiles', the values will become portable.
Comment 9 _ tboudreau 2009-01-14 01:37:44 UTC
> profiles are stored in portable form if possible (if you are on mac, keybindings containing alt have to be hardcoded)

Not a big deal.

> keybindings exported through options/keybindings/manage profiles are stored in the same way

Fine

> in case you will use keybindings from an older NB version and copy/import them inside userdir, hardcoded values will
be used

Unfortunate but I can live with it (I have a module that could export a keybinding profile as an NBM with the keybinding
profile defined in its layer - it can look for hardcoded things and give a warning or something).