Changeset 128
- Timestamp:
- Oct 7, 2007, 9:44:45 PM (17 years ago)
- Location:
- trunk/vnc/vnc_javasrc
- Files:
-
- 2 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 -
trunk/vnc/vnc_javasrc/VncCanvas.java
r66 r128 80 80 // True if we process keyboard and mouse events. 81 81 boolean inputEnabled; 82 int extraModifiers = 0; 82 83 83 84 // … … 1511 1512 synchronized(rfb) { 1512 1513 try { 1514 if (extraModifiers != 0) { 1515 evt.setModifiers(evt.getModifiers() | extraModifiers); 1516 } 1513 1517 rfb.writeKeyEvent(evt); 1514 1518 } catch (Exception e) {
Note: See TracChangeset
for help on using the changeset viewer.