简体   繁体   English

如何在Eclipse建议弹出窗口中使用键盘主键向上/向下导航?

[英]How to navigate up/down using keyboard home keys in Eclipse's suggestions pop up window?

When Eclipse shows a popup for code completion, how do you change the highlighted option using the keyboard home keys? 当Eclipse显示用于代码完成的弹出窗口时,如何使用键盘主键更改突出显示的选项? Currently, if the thing I want is third or fourth on the list of suggestions, I have to use the mouse to select it, or use the arrow keys. 当前,如果我想要的东西在建议列表中的第三或第四,我必须使用鼠标来选择它,或者使用箭头键。 Is there a way to use the keyboard home keys/ shortcuts with ctrl/alt to do this? 有没有办法使用键盘主键/快捷键和ctrl / alt来做到这一点?

I'm assuming you want to select from the code completion menu by X for up and Y for down. 我假设您想从代码完成菜单中选择X表示向上, Y表示向下。 Go to Preferences > Keys and bind the commands Line Up and Line Down to X and Y , respectively. 转到“首选项”>“键”,然后将“ Line Up和“ Line Down ”命令分别绑定到XY Make sure that in the When drop-down you select In Windows . 确保在“ When下拉列表中选择“ In Windows

Note that after the settings are applied, X ( Y ) also makes the cursor go one line up (down) in the source editor. 请注意,应用设置后, XY )还将使光标在源代码编辑器中向上(向下)一行。 Personally, I use X = Ctrl+P and Y = Ctrl+N which means I can navigate lines and select entries from the code completion menu without lifting my hands off the keyboard. 就个人而言,我使用X = Ctrl+PY = Ctrl+N ,这意味着我可以在不抬起键盘的情况下导航行并从代码完成菜单中选择条目。

Unfortunately, these bindings don't work with other pop-up lists in Eclipse, eg quick outline ( Ctrl+O ) or quick access ( Ctrl+3 ). 不幸的是,这些绑定不适用于Eclipse中的其他弹出列表,例如快速大纲( Ctrl+O )或快速访问( Ctrl+3 )。 I'd love to find out how to bind these too. 我也想知道如何绑定这些。

Arrow keys always work for me. 箭头键始终对我有用。 Can you be little more specific as to what perspective, editor, etc? 您能否更具体地说明什么角度,编辑器等?

I get a code completion popup when I press Ctrl + 1 in the Java editor. 当我在Java编辑器中按Ctrl + 1时,会出现一个代码完成弹出窗口。 From then on, I can use the arrow keys to navigate. 从那时起,我可以使用箭头键进行导航。

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

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