summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2009-06-28 22:25:44 +0000
committerMatthias Melcher <fltk@matthiasm.com>2009-06-28 22:25:44 +0000
commit121138fa9333e32a1419d8f3eb3c45f784625d77 (patch)
treef7566b5152fd0f8e724538b3b0f8aeb02f0c9661 /src
parent7f18e1002fb378e11ec447b5319221e77f198864 (diff)
- Fixed unexpected shortcut behavior for Win32 (STR #2199)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6802 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/fl_shortcut.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fl_shortcut.cxx b/src/fl_shortcut.cxx
index 50acfdcf8..cd6f1cf9e 100644
--- a/src/fl_shortcut.cxx
+++ b/src/fl_shortcut.cxx
@@ -305,6 +305,10 @@ char Fl_Widget::label_shortcut(const char *t) {
}
int Fl_Widget::test_shortcut(const char *t) {
+ #ifdef WIN32
+ // on MSWindows, users expect shortcuts to work only when the Alt modifier is pressed
+ if (Fl::event_state(FL_ALT)==0) return 0;
+ #endif
char c = Fl::event_text()[0];
if (!c || !t) return 0;
if (c == label_shortcut(t))