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 203203 - Global shortcuts cannot be un-defined by a keymap profile
Summary: Global shortcuts cannot be un-defined by a keymap profile
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Key bindings (show other bugs)
Version: 7.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks: 201274 201277
  Show dependency tree
 
Reported: 2011-10-06 09:05 UTC by Svata Dedic
Modified: 2012-05-29 12:25 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed changes (27.66 KB, patch)
2012-05-17 09:19 UTC, Svata Dedic
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Svata Dedic 2011-10-06 09:05:31 UTC
A keymap profile may only modify or add keystrokes to the basic set of Shortcuts. If there's a global Shortcut registered, the profile may not remove it - e.g. when the selected profile already contains another binding for an action, it cannot un-bind the action from the original (default) keystroke.
Comment 1 Svata Dedic 2012-05-17 08:40:47 UTC
The API of the keymap options storage should be extended to mask out a global shortcut. The proposed way is to create a file 
    "shortcut.removed", 
which will be interpreted by removing the parent's binding from the result merged key map.

The change has to be code both in NbKeyMap (o.n.core) and keymap options.

At the same time, I would like to remove ugly handling of keymap switch: currently when keymaps are switched, the global Shortcut folder is permanently altered: shortcuts NOT present in the current profile are deleted, shortcuts redefined are created or changed. 

But shipped keymaps generally only contain differences between the base Shortcut folder and the particular profile. When an effective keymap is built, then selected by the user as the current one, it will permanently change the base keymap (Shortcuts folder). Subsequent merges of Shortcuts + some keymap will produce different results, which is not desirable.

The NbKeymap implementation already contains concept of overriding shortcuts by registrations found in a profile folder, so removing the 'sync' step should from keymap option implementation not have any impact.
Comment 2 Svata Dedic 2012-05-17 09:19:35 UTC
Created attachment 119558 [details]
Proposed changes
Comment 3 Svata Dedic 2012-05-23 06:45:49 UTC
Will commit the change tomorrow if there are no objections
Comment 4 Svata Dedic 2012-05-25 12:46:36 UTC
implemened in http://hg.netbeans.org/jet-main/rev/3a432d963791
Comment 5 Jesse Glick 2012-05-29 12:25:00 UTC
*.shadow_hidden would be more natural than *.removed, since it would align with the syntax of MultiFileSystem masks (and someday might actually be able to use MFS). Probably not important, just a suggestion.