Changeset 128 for trunk/vnc/vnc_javasrc/ButtonPanel.java
- Timestamp:
- Oct 7, 2007, 9:44:45 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/vnc/vnc_javasrc/ButtonPanel.java
r66 r128 28 28 import java.io.*; 29 29 30 class ButtonPanel extends Panel implements ActionListener {30 class ButtonPanel extends Panel implements ActionListener, ItemListener { 31 31 32 32 VncViewer viewer; … … 37 37 Button ctrlAltDelButton; 38 38 Button refreshButton; 39 Checkbox altCheckbox; 40 Checkbox ctrlCheckbox; 39 41 40 42 ButtonPanel(VncViewer v) { … … 66 68 add(refreshButton); 67 69 refreshButton.addActionListener(this); 70 71 altCheckbox = new Checkbox("Alt"); 72 altCheckbox.setEnabled(false); 73 add(altCheckbox); 74 altCheckbox.addItemListener(this); 75 ctrlCheckbox = new Checkbox("Control"); 76 ctrlCheckbox.setEnabled(false); 77 add(ctrlCheckbox); 78 ctrlCheckbox.addItemListener(this); 68 79 } 69 80 … … 104 115 public void enableRemoteAccessControls(boolean enable) { 105 116 ctrlAltDelButton.setEnabled(enable); 117 ctrlCheckbox.setEnabled(enable); 118 altCheckbox.setEnabled(enable); 106 119 } 107 120 … … 151 164 } 152 165 } 166 public void itemStateChanged(ItemEvent evt) { 167 viewer.moveFocusToDesktop(); 168 int state = evt.getStateChange(); 169 int extraModifiers = 0; 170 if (altCheckbox.getState()) { extraModifiers |= InputEvent.ALT_MASK; } 171 if (ctrlCheckbox.getState()) { extraModifiers |= InputEvent.CTRL_MASK; } 172 viewer.vc.extraModifiers = extraModifiers; 173 } 153 174 } 154 175
Note: See TracChangeset
for help on using the changeset viewer.