X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-vnc-client.git/blobdiff_plain/6a62329fa573cd519cc36b6d491a7cdcc3261e01..2550d28023c866876770928a5094cbf97ef9401f:/ButtonPanel.java diff --git a/ButtonPanel.java b/ButtonPanel.java index 5cae865..73f2446 100644 --- a/ButtonPanel.java +++ b/ButtonPanel.java @@ -27,7 +27,7 @@ import java.awt.*; import java.awt.event.*; import java.io.*; -class ButtonPanel extends Panel implements ActionListener { +class ButtonPanel extends Panel implements ActionListener, ItemListener { VncViewer viewer; Button disconnectButton; @@ -36,6 +36,8 @@ class ButtonPanel extends Panel implements ActionListener { Button clipboardButton; Button ctrlAltDelButton; Button refreshButton; + Checkbox altCheckbox; + Checkbox ctrlCheckbox; ButtonPanel(VncViewer v) { viewer = v; @@ -65,6 +67,15 @@ class ButtonPanel extends Panel implements ActionListener { refreshButton.setEnabled(false); add(refreshButton); refreshButton.addActionListener(this); + + altCheckbox = new Checkbox("Alt"); + altCheckbox.setEnabled(false); + add(altCheckbox); + altCheckbox.addItemListener(this); + ctrlCheckbox = new Checkbox("Control"); + ctrlCheckbox.setEnabled(false); + add(ctrlCheckbox); + ctrlCheckbox.addItemListener(this); } // @@ -103,6 +114,8 @@ class ButtonPanel extends Panel implements ActionListener { public void enableRemoteAccessControls(boolean enable) { ctrlAltDelButton.setEnabled(enable); + ctrlCheckbox.setEnabled(enable); + altCheckbox.setEnabled(enable); } // @@ -150,5 +163,13 @@ class ButtonPanel extends Panel implements ActionListener { } } } + public void itemStateChanged(ItemEvent evt) { + viewer.moveFocusToDesktop(); + int state = evt.getStateChange(); + int extraModifiers = 0; + if (altCheckbox.getState()) { extraModifiers |= InputEvent.ALT_MASK; } + if (ctrlCheckbox.getState()) { extraModifiers |= InputEvent.CTRL_MASK; } + viewer.vc.extraModifiers = extraModifiers; + } }