diff options
author | Dmitri Trembovetski <[email protected]> | 2009-05-24 22:10:41 +0000 |
---|---|---|
committer | Dmitri Trembovetski <[email protected]> | 2009-05-24 22:10:41 +0000 |
commit | 1d428d4fce17329e7d3cc212ae45729836c07a25 (patch) | |
tree | f26090290f61834e3a876d24116b189fd1898f7b /src | |
parent | db459ddc1773193cb364c5f42c9ea439d574015c (diff) |
Newt fixes for Windows implementation: beginnings of proper modifier handling for key events; ignore WM_ERASEBG event to avoild flickering when resizing
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1912 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src')
-rw-r--r-- | src/newt/native/InputEvent.h | 3 | ||||
-rwxr-xr-x | src/newt/native/WindowsWindow.c | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/newt/native/InputEvent.h b/src/newt/native/InputEvent.h index 1284a8535..b42c06d21 100644 --- a/src/newt/native/InputEvent.h +++ b/src/newt/native/InputEvent.h @@ -39,5 +39,8 @@ #define EVENT_META_MASK 4 #define EVENT_ALT_MASK 8 #define EVENT_ALT_GRAPH_MASK 32 +#define EVENT_BUTTON1_MASK (1<<6) +#define EVENT_BUTTON2_MASK (1<<7) +#define EVENT_BUTTON3_MASK (1<<8) #endif diff --git a/src/newt/native/WindowsWindow.c b/src/newt/native/WindowsWindow.c index a742f5acf..9d802b213 100755 --- a/src/newt/native/WindowsWindow.c +++ b/src/newt/native/WindowsWindow.c @@ -94,6 +94,16 @@ static jint ConvertModifiers(WPARAM wParam) { if (HIBYTE(GetKeyState(VK_MENU)) != 0) { modifiers |= EVENT_ALT_MASK; } + if (HIBYTE(GetKeyState(VK_LBUTTON)) != 0) { + modifiers |= EVENT_BUTTON1_MASK; + } + if (HIBYTE(GetKeyState(VK_MBUTTON)) != 0) { + modifiers |= EVENT_BUTTON2_MASK; + } + if (HIBYTE(GetKeyState(VK_RBUTTON)) != 0) { + modifiers |= EVENT_BUTTON3_MASK; + } + return modifiers; } @@ -209,6 +219,12 @@ static LRESULT CALLBACK wndProc(HWND wnd, UINT message, useDefWindowProc = 1; break; + case WM_ERASEBKGND: + // ignore erase background + useDefWindowProc = 0; + break; + + // FIXME: generate EVENT_MOUSE_ENTERED, EVENT_MOUSE_EXITED default: useDefWindowProc = 1; |