Hi,

I tried to implement shortcuts for traversing the completion popup menu up and down using ctrl+p and ctrl+n, instead of using the arrow keys (and having to leave the home row).

I think I have the basic premise right (see diff below), however the keystroke does not seem to reach the CompletionScrollPane. Ctrl+n is consumed by the "new file" shortcut, and even if I unbound that nothing happens.

Any pointers as to what I am missing here? Assume that I have no experience with the NetBeans source code and structure.

Cheers!

git diff ide/editor.completion/src/org/netbeans/modules/editor/completion/CompletionScrollPane.java diff --git a/ide/editor.completion/src/org/netbeans/modules/editor/completion/CompletionScrollPane.java b/ide/editor.completion/src/org/netbeans/modules/editor/completion/CompletionScrollPane.java
index d112dbd564..34c2f9eae0 100644
--- a/ide/editor.completion/src/org/netbeans/modules/editor/completion/CompletionScrollPane.java +++ b/ide/editor.completion/src/org/netbeans/modules/editor/completion/CompletionScrollPane.java
@@ -223,6 +223,16 @@ public class CompletionScrollPane extends JScrollPane {
         KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0),
         BaseKit.downAction, component);

+        // Register alternative up key
+        registerKeybinding(ACTION_COMPLETION_UP, COMPLETION_UP,
+        KeyStroke.getKeyStroke(KeyEvent.VK_P, KeyEvent.CTRL_DOWN_MASK),
+        BaseKit.upAction, component);
+
+        // Register alternative down key
+        registerKeybinding(ACTION_COMPLETION_DOWN, COMPLETION_DOWN,
+        KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.CTRL_DOWN_MASK),
+        BaseKit.downAction, component);
+
         // Register PgDn key
         registerKeybinding(ACTION_COMPLETION_PGDN, COMPLETION_PGDN,
         KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0),


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
For additional commands, e-mail: dev-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to