Handling a full range of keys for the menu key is not as trivial in FLTK as
with raw X11, so do what the Windows client did and restrict the available
keys to just the function keys.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4444 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/vncviewer/OptionsDialog.cxx b/vncviewer/OptionsDialog.cxx
index 8fe7eec..7a2cf2e 100644
--- a/vncviewer/OptionsDialog.cxx
+++ b/vncviewer/OptionsDialog.cxx
@@ -253,11 +253,22 @@
 #endif
 
   /* Input */
+  const char *menuKeyBuf;
+
   viewOnlyCheckbox->value(viewOnly);
   acceptClipboardCheckbox->value(acceptClipboard);
   sendClipboardCheckbox->value(sendClipboard);
   sendPrimaryCheckbox->value(sendPrimary);
 
+  menuKeyChoice->value(0);
+
+  menuKeyBuf = menuKey;
+  if (menuKeyBuf[0] == 'F') {
+    int num = atoi(menuKeyBuf+1);
+    if ((num >= 1) && (num <= 12))
+      menuKeyChoice->value(num);
+  }
+
   /* Misc. */
   sharedCheckbox->value(shared);
   fullScreenCheckbox->value(fullScreen);
@@ -342,6 +353,14 @@
   sendClipboard.setParam(sendClipboardCheckbox->value());
   sendPrimary.setParam(sendPrimaryCheckbox->value());
 
+  if (menuKeyChoice->value() == 0)
+    menuKey.setParam("");
+  else {
+    char buf[16];
+    sprintf(buf, "F%d", menuKeyChoice->value());
+    menuKey.setParam(buf);
+  }
+
   /* Misc. */
   shared.setParam(sharedCheckbox->value());
   fullScreen.setParam(fullScreenCheckbox->value());
@@ -664,6 +683,17 @@
                                                      _("Send primary selection and cut buffer as clipboard")));
   ty += CHECK_HEIGHT + TIGHT_MARGIN;
 
+  menuKeyChoice = new Fl_Choice(LBLLEFT(tx, ty, 150, CHOICE_HEIGHT, _("Menu key")));
+
+  menuKeyChoice->add(_("None"), 0, NULL, (void*)0, FL_MENU_DIVIDER);
+  for (int i = 1;i <= 12;i++) {
+    char buf[16];
+    sprintf(buf, "F%d", i);
+    menuKeyChoice->add(buf, 0, NULL, (void*)i, 0);
+  }
+
+  ty += CHOICE_HEIGHT + TIGHT_MARGIN;
+
   group->end();
 }