Unbind F1 'Help' keyboard shortcut in eclipse

后端 未结 4 941
执笔经年
执笔经年 2020-12-30 02:44

How can you unbind the F1 keyboard shortcut in Eclipse? I have unbound it using the Windows -> Preferences -> General -> Keys, but it appears to have no effect (

相关标签:
4条回答
  • 2020-12-30 03:13

    It doesn't matter that F1 generates a help event on Windows. As explained here, SWT generates both a help event and a key event when F1 is pressed. You can map things to F1 and it will work, but it will still also open help.

    To fix this, delete the JAR file in the plugins directory that starts with "org.eclipse.help.base". Help will no longer open!

    Edit: in fact, I use this to smoke Eclipse junk:

    rm -rf readme
    rm -rf *.html
    
    rm -rf features/org.eclipse.aether*
    rm -rf features/org.eclipse.cvs*
    rm -rf features/org.eclipse.egit*
    rm -rf features/org.eclipse.gef*
    rm -rf features/org.eclipse.help.ui*
    rm -rf features/org.eclipse.jgit*
    rm -rf features/org.eclipse.m2e*
    rm -rf features/org.eclipse.mylyn*
    rm -rf features/org.eclipse.team.cvs*
    rm -rf features/org.eclipse.wb*
    rm -rf features/org.eclipse.wst*
    rm -rf features/org.eclipse.xsd*
    rm -rf features/org.eclipse.epp.mpc*
    rm -rf features/org.eclipse.buildship*
    rm -rf features/org.eclipse.oomph*
    rm -rf features/org.eclipse.recommenders*
    
    rm -rf plugins/org.eclipse.aether*
    rm -rf plugins/org.eclipse.cvs*
    rm -rf plugins/org.eclipse.egit*
    rm -rf plugins/org.eclipse.gef*
    rm -rf plugins/org.eclipse.help.ui*
    rm -rf plugins/org.eclipse.jgit*
    rm -rf plugins/org.eclipse.m2e*
    rm -rf plugins/org.eclipse.mylyn*
    rm -rf plugins/org.eclipse.team.cvs*
    rm -rf plugins/org.eclipse.wb*
    rm -rf plugins/org.eclipse.wst*
    rm -rf plugins/org.eclipse.xsd*
    rm -rf plugins/org.eclipse.epp.mpc*
    rm -rf plugins/org.eclipse.buildship*
    rm -rf plugins/org.eclipse.oomph*
    rm -rf plugins/org.eclipse.recommenders*
    
    0 讨论(0)
  • 2020-12-30 03:17

    If you installed eclipse in the default location, go to:

    C:\Users\[your username]\.p2\pool\plugins
    

    and search for:

    org.eclipse.help.base
    

    then, after closing eclipse, add .jbak to the end of the file you found. This should fix the problem. If for whatever reason you need it back, just remove the .jbak from the file name and restart eclipse.

    Note: you will need to agree to windows warning and close eclipse before renaming the file.

    0 讨论(0)
  • Edit: below commands ruin your code completion if you used the OOMPH installer. I didn’t restore all plugins one by one, restart Eclipse to see if it works again, but just restored all OOMPH and recommenders features and plugins. For that I downloaded the Eclipse archive (in my case JEE) and just copied the features and plugins from the extracted archive to my .p2\pool\feature respectively \plugins.

    To modify @NateS’s answer for PowerShell so you can just copy it. If you installed Eclipse via installer go to your .p2 directory (most likely C:\Users\Name.p2\pool and run the commands from there.

    Remove-Item -Force -Recurse features/org.eclipse.aether*
    Remove-Item -Force -Recurse features/org.eclipse.gef*
    Remove-Item -Force -Recurse features/org.eclipse.help.ui*
    Remove-Item -Force -Recurse features/org.eclipse.jgit*
    Remove-Item -Force -Recurse features/org.eclipse.m2e*
    Remove-Item -Force -Recurse features/org.eclipse.mylyn*
    Remove-Item -Force -Recurse features/org.eclipse.team.cvs*
    Remove-Item -Force -Recurse features/org.eclipse.wb*
    Remove-Item -Force -Recurse features/org.eclipse.wst*
    Remove-Item -Force -Recurse features/org.eclipse.xsd*
    Remove-Item -Force -Recurse features/org.eclipse.epp.mpc*
    Remove-Item -Force -Recurse features/org.eclipse.buildship*
    Remove-Item -Force -Recurse features/org.eclipse.oomph*
    Remove-Item -Force -Recurse features/org.eclipse.recommenders*
    
    Remove-Item -Force -Recurse plugins/org.eclipse.aether*
    Remove-Item -Force -Recurse plugins/org.eclipse.gef*
    Remove-Item -Force -Recurse plugins/org.eclipse.help.ui*
    Remove-Item -Force -Recurse plugins/org.eclipse.jgit*
    Remove-Item -Force -Recurse plugins/org.eclipse.m2e*
    Remove-Item -Force -Recurse plugins/org.eclipse.mylyn*
    Remove-Item -Force -Recurse plugins/org.eclipse.team.cvs*
    Remove-Item -Force -Recurse plugins/org.eclipse.wb*
    Remove-Item -Force -Recurse plugins/org.eclipse.wst*
    Remove-Item -Force -Recurse plugins/org.eclipse.xsd*
    Remove-Item -Force -Recurse plugins/org.eclipse.epp.mpc*
    Remove-Item -Force -Recurse plugins/org.eclipse.buildship*
    Remove-Item -Force -Recurse plugins/org.eclipse.oomph*
    Remove-Item -Force -Recurse plugins/org.eclipse.recommenders*
    

    I actually like JGit and use it so I removed that line for the feature/ and plugins/. You could also comment them out by adding a % in front of the line.

    Go to the directory where your eclipse.exe is (either way you choose the path yourself when you extracted the archive or when you installed it. Mine is under C:\eclipse\jee-oxygen\eclipse) and run these two commands.

    Remove-Item -Force -Recurse readme
    Remove-Item -Force -Recurse *.html
    
    0 讨论(0)
  • 2020-12-30 03:28

    According to this Microsoft KB the F1 is a system-wide shortcut, so you won't be able to remap it inside your application.

    0 讨论(0)
提交回复
热议问题