Index: invirt-vnc-client/ButtonPanel.java =================================================================== --- invirt-vnc-client.orig/ButtonPanel.java 2008-10-31 06:08:45.000000000 -0400 +++ invirt-vnc-client/ButtonPanel.java 2008-10-31 06:09:10.000000000 -0400 @@ -27,7 +27,7 @@ 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 @@ Button clipboardButton; Button ctrlAltDelButton; Button refreshButton; + Checkbox altCheckbox; + Checkbox ctrlCheckbox; ButtonPanel(VncViewer v) { viewer = v; @@ -65,6 +67,15 @@ 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 @@ public void enableRemoteAccessControls(boolean enable) { ctrlAltDelButton.setEnabled(enable); + ctrlCheckbox.setEnabled(enable); + altCheckbox.setEnabled(enable); } // @@ -150,5 +163,13 @@ } } } + 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; + } } Index: invirt-vnc-client/VncCanvas.java =================================================================== --- invirt-vnc-client.orig/VncCanvas.java 2008-10-31 06:08:45.000000000 -0400 +++ invirt-vnc-client/VncCanvas.java 2008-10-31 06:09:10.000000000 -0400 @@ -79,6 +79,7 @@ // True if we process keyboard and mouse events. boolean inputEnabled; + int extraModifiers = 0; // // The constructors. @@ -1510,6 +1511,9 @@ // Input enabled. synchronized(rfb) { try { + if (extraModifiers != 0) { + evt.setModifiers(evt.getModifiers() | extraModifiers); + } rfb.writeKeyEvent(evt); } catch (Exception e) { e.printStackTrace();