diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2006-06-09 07:48:08 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2006-06-09 07:48:08 +0000 |
| commit | 428a283f83e3c9c6e683062079cacbebf43ce3ab (patch) | |
| tree | db03643ede1581ef312615c624005b2c69b15b2d /src/Fl_win32.cxx | |
| parent | 007fc30ca4e26595c3a21dd07600e6517d5914a4 (diff) | |
Added an event variable "Fl::event_original_key()" which returns the current key code (see Fl::event_key()) before it gets mangled through the NumLock keypad conversion. This way, an application can differentiate between an arrow key and a numeric keypad w/NumLock off.
On Win32, releasing a numeric keypad key w/NumLock off wiould return the wrong keycode (keypad instead of arrow key).
Documentation changed accordingly. X11 code is yet to be tested.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5188 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_win32.cxx')
| -rw-r--r-- | src/Fl_win32.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index ade91e1c9..401c1b7a9 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -803,7 +803,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar case WM_KEYUP: case WM_SYSKEYUP: // save the keysym until we figure out the characters: - Fl::e_keysym = ms2fltk(wParam,lParam&(1<<24)); + Fl::e_keysym = Fl::e_original_keysym = ms2fltk(wParam,lParam&(1<<24)); // See if TranslateMessage turned it into a WM_*CHAR message: if (PeekMessage(&fl_msg, hWnd, WM_CHAR, WM_SYSDEADCHAR, PM_REMOVE)) { uMsg = fl_msg.message; @@ -832,10 +832,6 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar } if (GetKeyState(VK_SCROLL)) state |= FL_SCROLL_LOCK; Fl::e_state = state; - if (lParam & (1<<31)) { // key up events. - if (Fl::handle(FL_KEYUP, window)) return 0; - break; - } static char buffer[2]; if (uMsg == WM_CHAR || uMsg == WM_SYSCHAR) { buffer[0] = char(wParam); @@ -894,6 +890,10 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar Fl::e_length = 0; } Fl::e_text = buffer; + if (lParam & (1<<31)) { // key up events. + if (Fl::handle(FL_KEYUP, window)) return 0; + break; + } // for (int i = lParam&0xff; i--;) while (window->parent()) window = window->window(); if (Fl::handle(FL_KEYBOARD,window)) return 0; |
