diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-04-27 14:39:27 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-04-27 14:39:27 +0000 |
| commit | ff3295f0365fcb3262129047311072138e208fcd (patch) | |
| tree | 6b64d7cec6c67cdd487b5997fafbe5718342576b /src/Fl_win32.cxx | |
| parent | 36b469928ed6833c792dc1a7451e6b65b08dc266 (diff) | |
Handle WM_ACTIVATEAPP message under WIN32, using GetAsyncKeyState() for
all of the key and button states in FLTK.
SunOS 4.x changes (check for <sys/stdtypes.h> and don't rely on
realloc(NULL, size) working - this doesn't work on a lot of platforms!)
Fix nesting of #ifdefs in vsnprintf.c - the C++ wrapper stuff wasn't
being included outside the checks for the individual functions...
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1444 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_win32.cxx')
| -rw-r--r-- | src/Fl_win32.cxx | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index a83e6307e..b16f1b92b 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_win32.cxx,v 1.33.2.33 2001/04/22 16:54:23 spitzak Exp $" +// "$Id: Fl_win32.cxx,v 1.33.2.34 2001/04/27 14:39:27 easysw Exp $" // // WIN32-specific code for the Fast Light Tool Kit (FLTK). // @@ -418,8 +418,6 @@ static Fl_Window* resize_bug_fix; static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - -#if 1 // Matt: When dragging a full window, MSWindows on 'slow' // machines can lose track of the window refresh area. It sends some kind // of panic message to the desktop that in turn sends this message on to @@ -434,7 +432,6 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar cnt = 0; } else cnt = 1; } else if (uMsg == WM_PAINT) cnt = 0; -#endif fl_msg.message = uMsg; @@ -510,6 +507,30 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar } break; + case WM_ACTIVATEAPP: + // From eric@vfx.sel.sony.com, we should process WM_ACTIVATEAPP + // messages to restore the correct state of the shift/ctrl/alt/lock + // keys... Added control, shift, alt, and meta keys, mouse buttons, + // and changed to use GetAsyncKeyState... + if (!wParam) + { + ulong state = 0; + if (GetAsyncKeyState(VK_CAPITAL)) state |= FL_CAPS_LOCK; + if (GetAsyncKeyState(VK_NUMLOCK)) state |= FL_NUM_LOCK; + if (GetAsyncKeyState(VK_SCROLL)) state |= FL_SCROLL_LOCK; + if (GetAsyncKeyState(VK_CONTROL)) state |= FL_CTRL; + if (GetAsyncKeyState(VK_SHIFT)) state |= FL_SHIFT; + if (GetAsyncKeyState(VK_MENU)) state |= FL_ALT; + if (GetAsyncKeyState(VK_LWIN) || + GetAsyncKeyState(VK_RWIN)) state |= FL_META; + if (GetAsyncKeyState(VK_LBUTTON)) state |= FL_BUTTON1; + if (GetAsyncKeyState(VK_MBUTTON)) state |= FL_BUTTON2; + if (GetAsyncKeyState(VK_RBUTTON)) state |= FL_BUTTON3; + Fl::e_state = state; + return 0; + } + break; + case WM_KEYDOWN: case WM_SYSKEYDOWN: case WM_KEYUP: @@ -955,5 +976,5 @@ void Fl_Window::make_current() { } // -// End of "$Id: Fl_win32.cxx,v 1.33.2.33 2001/04/22 16:54:23 spitzak Exp $". +// End of "$Id: Fl_win32.cxx,v 1.33.2.34 2001/04/27 14:39:27 easysw Exp $". // |
