Eclipse 的“右键单击”键盘快捷键?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1209505/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 13:55:58  来源:igfitidea点击:

“Right Click” keyboard short cut for Eclipse?

eclipsemacoskeyboard-shortcutsosx-leopard

提问by Tony Eichelberger

I am switching back and forth between eclipse and intellij and am really missing the ability to "right click" using the keyboard when I am in eclipse. I am running OSX Leopard.

我在eclipse和intellij之间来回切换,当我在eclipse中时,我真的缺少使用键盘“右键单击”的能力。我正在运行 OSX Leopard。

Does anyone know if this can be setup in the keys preferences, or is there a plugin that handles simulating a context menu at the current focused component?

有谁知道这是否可以在键首选项中设置,或者是否有一个插件可以处理在当前聚焦的组件上模拟上下文菜单?

回答by David Chandler

As of Eclipse Juno, Shift+F10 works on Mac to bring up the context menu. It's mapped in Preferences | Keys as Show Context Menu.

从 Eclipse Juno 开始,Shift+F10 可在 Mac 上使用以调出上下文菜单。它映射在首选项 | 键作为显示上下文菜单。

回答by Rob Hruska

Windows

视窗

For Windows, I don't think you necessarily need an Eclipse-specific solution. Your keyboard might have a Context Menu key, or you can use Shift+ F10to bring up the context menu.

对于 Windows,我认为您不一定需要特定于 Eclipse 的解决方案。您的键盘可能有一个上下文菜单键,或者您可以使用Shift+ 调F10出上下文菜单。

Source

来源

OSX

操作系统

After you updated your question to be specific to OSX, I did some searching, and it doesn't seem like there's a built-in OSX way to bring up a context menu. You might be able to find a program that will let you configure keystrokes to simulate mouse clicks, and then configure a shortcut to Ctrl+ Click.

在您将问题更新为特定于 OSX 后,我进行了一些搜索,似乎没有内置的 OSX 方式来调出上下文菜单。您或许可以找到一个程序,让您配置击键以模拟鼠标单击,然后配置Ctrl+的快捷方式Click

Eclipse Configuration

日食配置

In Preferences -> General -> Keysthere are several "Menu" actions that are bindable. Perhaps you can use these? When I filter the options for "Menu", I see, among others:

Preferences -> General -> Keys有几个“菜单”行为可绑定。也许你可以使用这些?当我过滤“菜单”选项时,我看到:

  • Show Refactor Quick Menu (Alt+ Shift+ T)
  • Show Source Quick Menu (Alt+ Shift+ S)
  • etc.
  • 显示重构快捷菜单 ( Alt+ Shift+ T)
  • 显示源快捷菜单 ( Alt+ Shift+ S)
  • 等等。

Alternatively, you could just find those commands from the context menu that you use most frequently and bind some keyboard shortcuts to them in Preferences -> General -> Keys.

或者,您可以从上下文菜单中找到最常用的那些命令,并在首选项 -> 常规 -> 键中将一些键盘快捷键绑定到它们。

回答by jamesh

On the old Apple branded external keyboards, the menu buttonis to the right of the space bar (Alt Gr, on PC style keyboards). Looking at the newer keyboards, and the Mac Book Pros, it doesn't seem to be there (guess it went the same way as the Home, End, Page Up, Page Downand Deletekeys).

在旧的 Apple 品牌外置键盘上,菜单按钮位于空格的右侧(Alt Gr在 PC 样式键盘上)。综观新的键盘,和Mac书优点,它似乎并没有在那里(猜它去以同样的方式为HomeEndPage UpPage DownDelete键)。

Having a poke around the Preferences -> Keys preference page, I don't think there is a way of revealing the entire context menu.

浏览Preferences -> Keys 首选项页面,我认为没有办法显示整个上下文菜单。

Many of the sub-menus are available from the keyboard - the ones I have committed to muscular memoryare:

许多子菜单都可以从键盘上找到——我致力于肌肉记忆的是:

  • Alt+ ?+ T- refactoring menu, and the various refactorings available from the keyboard, using the modifiers Alt+ ?
  • Alt+ ?+ S- Source menu, and various operations beginning with Shift+ ?- including organize imports, reformat.
  • Shift+ ?+ T- open type
  • Shift+ ?+ R- open resource
  • Alt+ ?+ T- 重构菜单,以及从键盘可用的各种重构,使用修饰符Alt+?
  • Alt+ ?+ S- 源菜单,以及以Shift+ ?-开头的各种操作,包括组织导入、重新格式化。
  • Shift+ ?+ T- 开放式
  • Shift+ ?+ R- 打开资源

If all else fails, it is usually worth looking at Shift+ ?+ L- which shows all current keyboard mappings in a hover on the side of the screen.

如果所有其他方法都失败了,通常值得查看Shift+ ?+L- 它在屏幕侧面悬停时显示所有当前键盘映射。

With these shortcuts, I would recommend learning one a day. Their culmulative effect is considerable.

有了这些快捷方式,我建议每天学习一个。它们的累积效应是可观的。

I appreciate that this does not answer your question, but I hope it solves your problem.

我很感激这不能回答您的问题,但我希望它可以解决您的问题。

回答by Norman Cohen

Click on the trackpad with two fingers, sort of like Moe poking Curly in the eyes.

用两根手指点击触控板,有点像 Moe 戳 Curly 的眼睛。

回答by Steffen Opel

While this unfortunately won't provide a solution for your problem I think it's still worth pointing out the following from The SWT FAQ(Eclipse facilitates SWTto implement its UI):

虽然不幸的是这不会为您的问题提供解决方案,但我认为仍然值得从The SWT FAQ(Eclipse 促进SWT实现其 UI) 中指出以下内容:

Q: What are the standard keyboard shortcuts on Windows, Mac OS X, GTK?
A: Since SWT uses native controls, standard keyboard shortcuts can be used in SWT applications. Here is a useful Table of Keyboard Shortcuts.

问:Windows、Mac OS X、GTK 上的标准键盘快捷键是什么?
答:由于 SWT 使用本机控件,因此可以在 SWT 应用程序中使用标准键盘快捷键。这是一个有用的键盘快捷键表

Obviously your problem is manifesting itself in row 'Pop up contextual menu for currently selected objects'of this table, where all platforms but Mac OS do offer either shortcuts Shift+ F10or Menuor both.

显然,您的问题表现在该表的“当前选定对象的弹出上下文菜单”行中,其中除 Mac OS 外的所有平台都提供快捷方式Shift+F10菜单或两者兼而有之。

While I can understand that SWT is using the native GUI libraries of the operating system and consequently does not offer this by default, I'm quite surprised that a huge and excellent developer tool like Eclipse is not providing a workaround here. How does IntelliJ solve this issue?

虽然我可以理解 SWT 正在使用操作系统的本机 GUI 库,因此默认情况下不提供此功能,但令我感到惊讶的是,像 Eclipse 这样庞大而出色的开发人员工具没有在这里提供解决方法。IntelliJ 如何解决这个问题?

回答by Stephen Denne

Does your keyboard have a menu key?

你的键盘有菜单键吗?

回答by jjnguy

Well, I know that Windows have a key right between the right Windows key and the right Ctrlkey.

好吧,我知道 Windows 在正确的 Windows 键和正确的Ctrl键之间有一个键。

It is a context menu key. That may do what you want it to do.

它是一个上下文菜单键。这可能会做你想让它做的事情。

回答by Manish R Warang

For MacOS try the following, it works like a charm for me

对于 MacOS,请尝试以下操作,它对我来说就像一个魅力

Ctrl + Click

Ctrl + 单击