diff options
author | Pierre Ossman <ossman@cendio.se> | 2011-05-24 12:47:12 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2011-05-24 12:47:12 +0000 |
commit | 4e7271e060c2b0c9be9649692f0c608604ea545a (patch) | |
tree | b89ec5241c87683c4b67f816a4df0252515b1552 /vncviewer/OptionsDialog.cxx | |
parent | df0ed9f731b2494677651ff5c0bebcf989cbb8b3 (diff) | |
download | tigervnc-4e7271e060c2b0c9be9649692f0c608604ea545a.tar.gz tigervnc-4e7271e060c2b0c9be9649692f0c608604ea545a.zip |
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
Diffstat (limited to 'vncviewer/OptionsDialog.cxx')
-rw-r--r-- | vncviewer/OptionsDialog.cxx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/vncviewer/OptionsDialog.cxx b/vncviewer/OptionsDialog.cxx index 8fe7eecf..7a2cf2ed 100644 --- a/vncviewer/OptionsDialog.cxx +++ b/vncviewer/OptionsDialog.cxx @@ -253,11 +253,22 @@ void OptionsDialog::loadOptions(void) #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 @@ void OptionsDialog::storeOptions(void) 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 @@ void OptionsDialog::createInputPage(int tx, int ty, int tw, int th) _("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(); } |