From: Brian P. Hinz Date: Wed, 15 Nov 2017 23:50:15 +0000 (-0500) Subject: Override default window manager key bindings better X-Git-Tag: v1.8.90~70 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d8809e334fb8095c4ba5520b0151e02bb0527b59;p=tigervnc.git Override default window manager key bindings better --- diff --git a/java/com/tigervnc/vncviewer/Viewport.java b/java/com/tigervnc/vncviewer/Viewport.java index a588f0f4..6fff9b4f 100644 --- a/java/com/tigervnc/vncviewer/Viewport.java +++ b/java/com/tigervnc/vncviewer/Viewport.java @@ -102,16 +102,15 @@ class Viewport extends JPanel implements ActionListener { releaseDownKeys(); } }); - Action action = new AbstractAction() { + // Override default key bindings from L&F + getActionMap().put("null", new AbstractAction() { public void actionPerformed(ActionEvent e) { } - }; - KeyStroke f10 = KeyStroke.getKeyStroke(KeyEvent.VK_F10, 0); - getInputMap(JComponent.WHEN_FOCUSED).put(f10, "requestFocus"); - getActionMap().put("requestFocus", new AbstractAction() { - public void actionPerformed(ActionEvent e) { - requestFocusInWindow(); - } }); + ArrayList keys = new ArrayList(); + keys.add(KeyStroke.getKeyStroke(KeyEvent.VK_F10, 0, true)); + keys.add(KeyStroke.getKeyStroke(KeyEvent.VK_ALT, 0, true)); + for (int i=0; i