Hi,

Don't know if this interests anyone but I've just added a menu option
(called "Start Menu") to the windows client to send Ctrl-Esc to server and
bring up the start menu (on Windows).  I've also added a button to the java
version to do the same.

Here are some patches for vncviewer v3.3.6 and java viewer v3.3.3r3:

diff -Naur vnc-3.3.6-winsrc/vncviewer/ClientConnection.cpp
vnc-3.3.6-winsrc-startmenu/vncviewer/ClientConnection.cpp
--- vnc-3.3.6-winsrc/vncviewer/ClientConnection.cpp     2002-11-04
16:26:14.000000000 +0100
+++ vnc-3.3.6-winsrc-startmenu/vncviewer/ClientConnection.cpp   2002-12-10
10:29:08.000000000 +0100
@@ -311,7 +311,8 @@
                AppendMenu(hsysmenu, MF_SEPARATOR, NULL, NULL);
                AppendMenu(hsysmenu, MF_STRING, ID_FULLSCREEN,
_T("&Full screen"));
                AppendMenu(hsysmenu, MF_SEPARATOR, NULL, NULL);
-               AppendMenu(hsysmenu, MF_STRING, ID_CONN_CTLALTDEL,
_T("Send Ctl-Alt-Del"));
+    AppendMenu(hsysmenu, MF_STRING, ID_CONN_CTLALTDEL, _T("Send
Ctl-Alt-Del"));
+    AppendMenu(hsysmenu, MF_STRING, ID_CONN_CTLESC, _T("Start Menu"));
                AppendMenu(hsysmenu, MF_STRING, ID_CONN_CTLDOWN,
_T("Ctrl Down"));
                AppendMenu(hsysmenu, MF_STRING, ID_CONN_CTLUP,
_T("Ctrl Up"));
                AppendMenu(hsysmenu, MF_STRING, ID_CONN_ALTDOWN,
_T("Alt Down"));
@@ -1268,6 +1269,13 @@
                                _this->SendFullFramebufferUpdateRequest();
                                return 0;
 
+      case ID_CONN_CTLESC:
+        _this->SendKeyEvent(XK_Control_L, true);
+        _this->SendKeyEvent(XK_Escape, true);
+        _this->SendKeyEvent(XK_Escape, false);
+        _this->SendKeyEvent(XK_Control_L,true);
+        return 0;
+
                        case ID_CONN_CTLALTDEL:
                                _this->SendKeyEvent(XK_Control_L, true);
                                _this->SendKeyEvent(XK_Alt_L,     true);
diff -Naur vnc-3.3.6-winsrc/vncviewer/res/resource.h
vnc-3.3.6-winsrc-startmenu/vncviewer/res/resource.h
--- vnc-3.3.6-winsrc/vncviewer/res/resource.h   2002-08-30
17:01:54.000000000 +0100
+++ vnc-3.3.6-winsrc-startmenu/vncviewer/res/resource.h 2002-12-10
10:28:58.000000000 +0100
@@ -25,6 +25,7 @@
 #define IDT_EMULATE3BUTTONSTIMER        152
 #define ID_CONN_SAVE_AS                 153
 #define IDC_NOCURSOR                    153
+#define ID_CONN_CTLESC                  154
 #define IDC_HOSTNAME_EDIT               1000
 #define IDC_SHARED                      1000
 #define IDC_DPYNUM_EDIT                 1001
@@ -63,6 +64,6 @@
 #define _APS_NEXT_RESOURCE_VALUE        154
 #define _APS_NEXT_COMMAND_VALUE         40010
 #define _APS_NEXT_CONTROL_VALUE         1035
-#define _APS_NEXT_SYMED_VALUE           154
+#define _APS_NEXT_SYMED_VALUE           155
 #endif
 #endif


diff -Naur vnc_javasrc/rfbProto.java vnc_javasrc-startmenu/rfbProto.java
--- vnc_javasrc/rfbProto.java   2000-10-26 14:53:24.000000000 +0100
+++ vnc_javasrc-startmenu/rfbProto.java 2002-12-10 17:03:32.000000000 +0100
@@ -522,7 +522,7 @@
       //
 
       if (key < 32) {
-       if ((evt.modifiers & Event.CTRL_MASK) != 0) {
+       if ((evt.modifiers & Event.CTRL_MASK) != 0 && key != 27) {
          key += 96;
          if (key == 127) // CTRL-_
            key = 95;
diff -Naur old_vnc_javasrc/vncviewer.java vnc_javasrc/vncviewer.java
--- vnc_javasrc/vncviewer.java  2000-10-26 14:48:52.000000000 +0100
+++ vnc_javasrc-startmenu/vncviewer.java        2002-12-10
17:05:58.000000000 +0100
@@ -60,6 +60,7 @@
   Button optionsButton;
   Button clipboardButton;
   Button ctrlAltDelButton;
+  Button startButton;
   optionsFrame options;
   clipboardFrame clipboard;
   authenticationPanel authenticator;
@@ -106,6 +107,9 @@
     ctrlAltDelButton = new Button("Send Ctrl-Alt-Del");
     ctrlAltDelButton.disable();
     buttonPanel.add(ctrlAltDelButton);
+    startButton = new Button("Start Menu");
+    startButton.disable();
+    buttonPanel.add(startButton);
 
     GridBagConstraints gbc = new GridBagConstraints();
     gbc.gridwidth = GridBagConstraints.REMAINDER;
@@ -134,6 +138,7 @@
       disconnectButton.enable();
       clipboardButton.enable();
       ctrlAltDelButton.enable();
+      startButton.enable();
 
       vc.processNormalProtocol();
 
@@ -352,7 +357,24 @@
       } catch (Exception e) {
        e.printStackTrace();
       }
+    } else if (evt.target == startButton) {
+
+      try {
+        Event startEvent = new Event(null, 0, null);
+
+        startEvent.key = 27; // Esc
+        startEvent.modifiers = Event.CTRL_MASK;
+
+        startEvent.id = Event.KEY_PRESS;
+        rfb.writeKeyEvent(startEvent);
+
+        startEvent.id = Event.KEY_RELEASE;
+        rfb.writeKeyEvent(startEvent);
+      } catch (Exception e) {
+        e.printStackTrace();
+      }
     }
+
     return false;
   }

_____________________________________________________________________
This message has been checked for all known viruses by the 
MessageLabs Virus Scanning Service
_______________________________________________
VNC-List mailing list
[EMAIL PROTECTED]
http://www.realvnc.com/mailman/listinfo/vnc-list

Reply via email to