source: trunk/packages/invirt-vnc-client/debian/patches/add-control-alt-checkboxes.patch @ 2227

Last change on this file since 2227 was 1438, checked in by broder, 16 years ago

Isolate our patches to the VNC client from the upstream TightVNC
source

File size: 2.4 KB
RevLine 
[1438]1Index: invirt-vnc-client/ButtonPanel.java
2===================================================================
3--- invirt-vnc-client.orig/ButtonPanel.java     2008-10-31 06:08:45.000000000 -0400
4+++ invirt-vnc-client/ButtonPanel.java  2008-10-31 06:09:10.000000000 -0400
5@@ -27,7 +27,7 @@
6 import java.awt.event.*;
7 import java.io.*;
8 
9-class ButtonPanel extends Panel implements ActionListener {
10+class ButtonPanel extends Panel implements ActionListener, ItemListener {
11 
12   VncViewer viewer;
13   Button disconnectButton;
14@@ -36,6 +36,8 @@
15   Button clipboardButton;
16   Button ctrlAltDelButton;
17   Button refreshButton;
18+  Checkbox altCheckbox;
19+  Checkbox ctrlCheckbox;
20 
21   ButtonPanel(VncViewer v) {
22     viewer = v;
23@@ -65,6 +67,15 @@
24     refreshButton.setEnabled(false);
25     add(refreshButton);
26     refreshButton.addActionListener(this);
27+   
28+    altCheckbox = new Checkbox("Alt");
29+    altCheckbox.setEnabled(false);
30+    add(altCheckbox);
31+    altCheckbox.addItemListener(this);
32+    ctrlCheckbox = new Checkbox("Control");
33+    ctrlCheckbox.setEnabled(false);
34+    add(ctrlCheckbox);
35+    ctrlCheckbox.addItemListener(this);
36   }
37 
38   //
39@@ -103,6 +114,8 @@
40 
41   public void enableRemoteAccessControls(boolean enable) {
42     ctrlAltDelButton.setEnabled(enable);
43+    ctrlCheckbox.setEnabled(enable);
44+    altCheckbox.setEnabled(enable);
45   }
46 
47   //
48@@ -150,5 +163,13 @@
49       }
50     }
51   }
52+    public void itemStateChanged(ItemEvent evt) {
53+       viewer.moveFocusToDesktop();
54+       int state = evt.getStateChange();
55+       int extraModifiers = 0;
56+       if (altCheckbox.getState()) { extraModifiers |= InputEvent.ALT_MASK; }
57+       if (ctrlCheckbox.getState()) { extraModifiers |= InputEvent.CTRL_MASK; }
58+       viewer.vc.extraModifiers = extraModifiers;
59+    }
60 }
61 
62Index: invirt-vnc-client/VncCanvas.java
63===================================================================
64--- invirt-vnc-client.orig/VncCanvas.java       2008-10-31 06:08:45.000000000 -0400
65+++ invirt-vnc-client/VncCanvas.java    2008-10-31 06:09:10.000000000 -0400
66@@ -79,6 +79,7 @@
67 
68   // True if we process keyboard and mouse events.
69   boolean inputEnabled;
70+  int extraModifiers = 0;
71 
72   //
73   // The constructors.
74@@ -1510,6 +1511,9 @@
75        // Input enabled.
76        synchronized(rfb) {
77          try {
78+           if (extraModifiers != 0) {
79+             evt.setModifiers(evt.getModifiers() | extraModifiers);
80+           }
81            rfb.writeKeyEvent(evt);
82          } catch (Exception e) {
83            e.printStackTrace();
Note: See TracBrowser for help on using the repository browser.