Search code examples
javakeyboard-shortcutsnetbeans-platform

Add Alt + F7 as shortcut to an action in Netbeans platform


I am developing a programming tool on the Netbeans Platform. In that, I have an action to find usages and I want to add Alt + F7 as a shortcut to fire my action. I have implemented this for Alt + F3 and some other shortcuts.

But in this case, Alt + F7 is already used in the Netbeans Platform to find usages.

How can I override Alt + F7 ?

Here is what I have already done:

@ActionRegistration(displayName = "#CTL_FindUsagesAction")
@ActionReferences(value = {
    @ActionReference(path = "Shortcuts", name = "A-F7"),

Solution

  • You can follow the following link where you can remove or add keymap for the project itself. Another suggestion, you can prevent Alt + F7 character when keypress and map it to another character and then use the other characters.

    enter image description here

    Source:https://ui.netbeans.org/docs/ui/keymap_option_panel/

    Read also this:https://netbeans.org/bugzilla/show_bug.cgi?id=249671