简体   繁体   English

Eclipse的“右击”键盘捷径?

[英]“Right Click” keyboard short cut for Eclipse?

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. 我在eclipse和intellij之间来回切换,当我在日食时,我真的错过了使用键盘“右键单击”的能力。 I am running OSX Leopard. 我正在运行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? 有没有人知道这是否可以在键首选项中设置,或者是否有一个插件处理模拟当前焦点组件的上下文菜单?

As of Eclipse Juno, Shift+F10 works on Mac to bring up the context menu. 从Eclipse Juno开始,Shift + F10可以在Mac上运行以显示上下文菜单。 It's mapped in Preferences | 它映射在Preferences |中 Keys as Show Context Menu. 键作为显示上下文菜单。

Windows 视窗

For Windows, I don't think you necessarily need an Eclipse-specific solution. 对于Windows,我认为您不一定需要特定于Eclipse的解决方案。 Your keyboard might have a Context Menu key, or you can use Shift + F10 to bring up the context menu. 键盘可能有上下文菜单键,或者您可以使用Shift + F10调出上下文菜单。

Source 资源

OSX 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. 在您将问题更新为特定于OSX之后,我进行了一些搜索,并且看起来似乎没有内置的OSX方式来显示上下文菜单。 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 . 您可能能够找到一个程序,可以让您配置击键来模拟鼠标单击,然后配置快捷键Ctrl + Click

Eclipse Configuration Eclipse配置

In Preferences -> General -> Keys there are several "Menu" actions that are bindable. Preferences -> General -> Keys ,有几个可绑定的“菜单”操作。 Perhaps you can use these? 也许你可以用这些? When I filter the options for "Menu", I see, among others: 当我过滤“菜单”的选项时,我看到,除其他外:

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

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. 或者,您可以从最常使用的上下文菜单中找到这些命令,并在“首选项” - >“常规” - >“键”中将一些键盘快捷键绑定到它们。

On the old Apple branded external keyboards, the menu button is to the right of the space bar ( Alt Gr , on PC style keyboards). 在旧的Apple品牌外部键盘上, 菜单按钮位于空格的右侧( Alt Gr ,在PC风格的键盘上)。 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 Down and Delete keys). 看看更新的键盘和Mac Book Pros,它似乎并不存在(猜测它与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. 围绕首选项 - >键首选项页面 ,我不认为有一种方法可以显示整个上下文菜单。

Many of the sub-menus are available from the keyboard - the ones I have committed to muscular memory are: 许多子菜单都可以从键盘上获得 - 我致力于肌肉记忆的是:

  • Alt + + T - refactoring menu, and the various refactorings available from the keyboard, using the modifiers Alt + Alt + + T - 重构菜单,以及键盘提供的各种重构,使用修改器Alt +
  • Alt + + S - Source menu, and various operations beginning with Shift + - including organize imports, reformat. Alt + + S - 源菜单以及以Shift + 开头的各种操作 - 包括组织导入,重新格式化。
  • Shift + + T - open type Shift + + T - 打开类型
  • Shift + + R - open resource 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. 我感谢这不能回答你的问题,但我希望它能解决你的问题。

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

你的键盘有菜单键吗?

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 SWT to implement its UI): 虽然遗憾的是这不会为您的问题提供解决方案,但我认为仍然需要从SWT FAQ中指出以下内容(Eclipse有助于SWT实现其UI):

Q: What are the standard keyboard shortcuts on Windows, Mac OS X, GTK? 问:Windows,Mac OS X,GTK上的标准键盘快捷键是什么?
A: Since SWT uses native controls, standard keyboard shortcuts can be used in SWT applications. 答:由于SWT使用本机控件,因此可以在SWT应用程序中使用标准键盘快捷键。 Here is a useful Table of Keyboard Shortcuts . 这是一个有用的键盘快捷键表

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 + F10 or Menu or both. 显然,您的问题显示在此表的“弹出当前所选对象的上下文菜单”行中,其中除Mac OS之外的所有平台都提供快捷键Shift + F10Menu或两者。

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. 虽然我可以理解SWT正在使用操作系统的本机GUI库,因此默认情况下不会提供这一点,但我很惊讶像Eclipse这样庞大而优秀的开发人员工具并没有提供解决方法。 How does IntelliJ solve this issue? IntelliJ如何解决这个问题?

Well, I know that Windows have a key right between the right Windows key and the right Ctrl key. 好吧,我知道Windows在右侧Windows键和右侧Ctrl键之间有一个键。

It is a context menu key. 它是一个上下文菜单键。 That may do what you want it to do. 这可能会做你想要它做的事情。

For MacOS try the following, it works like a charm for me 对于MacOS尝试以下,它对我来说就像一个魅力

Ctrl + Click 按Ctrl +单击

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM