source:
trunk/packages/invirt-vnc-client/debian/patches/add-control-alt-checkboxes.patch
@
2327
Last change on this file since 2327 was 1438, checked in by broder, 16 years ago | |
---|---|
File size: 2.4 KB |
-
ButtonPanel.java
old new 27 27 import java.awt.event.*; 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; 33 33 Button disconnectButton; … … 36 36 Button clipboardButton; 37 37 Button ctrlAltDelButton; 38 38 Button refreshButton; 39 Checkbox altCheckbox; 40 Checkbox ctrlCheckbox; 39 41 40 42 ButtonPanel(VncViewer v) { 41 43 viewer = v; … … 65 67 refreshButton.setEnabled(false); 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 70 81 // … … 103 114 104 115 public void enableRemoteAccessControls(boolean enable) { 105 116 ctrlAltDelButton.setEnabled(enable); 117 ctrlCheckbox.setEnabled(enable); 118 altCheckbox.setEnabled(enable); 106 119 } 107 120 108 121 // … … 150 163 } 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 -
invirt-vnc-client
old new 79 79 80 80 // True if we process keyboard and mouse events. 81 81 boolean inputEnabled; 82 int extraModifiers = 0; 82 83 83 84 // 84 85 // The constructors. … … 1510 1511 // Input enabled. 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) { 1515 1519 e.printStackTrace();
Note: See TracBrowser
for help on using the repository browser.