diff options
author | Brian P. Hinz <bphinz@users.sf.net> | 2017-11-15 18:50:15 -0500 |
---|---|---|
committer | Brian P. Hinz <bphinz@users.sf.net> | 2017-11-15 19:02:53 -0500 |
commit | d8809e334fb8095c4ba5520b0151e02bb0527b59 (patch) | |
tree | ad1a0a7b4b4765198daf340e42be7df0baaee733 /java | |
parent | bbbd12017235540659c14eb888a0687ecafa7157 (diff) | |
download | tigervnc-d8809e334fb8095c4ba5520b0151e02bb0527b59.tar.gz tigervnc-d8809e334fb8095c4ba5520b0151e02bb0527b59.zip |
Override default window manager key bindings better
Diffstat (limited to 'java')
-rw-r--r-- | java/com/tigervnc/vncviewer/Viewport.java | 15 |
1 files changed, 7 insertions, 8 deletions
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<KeyStroke> keys = new ArrayList<KeyStroke>(); + keys.add(KeyStroke.getKeyStroke(KeyEvent.VK_F10, 0, true)); + keys.add(KeyStroke.getKeyStroke(KeyEvent.VK_ALT, 0, true)); + for (int i=0; i<keys.size(); i++) + getInputMap(JComponent.WHEN_FOCUSED).put(keys.get(i), "null"); setFocusTraversalKeysEnabled(false); setFocusable(true); |