X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fwindows%2Fwindow.cpp;h=2af6b83917e153664f8f82220ba56f0849f7e802;hb=c3b9df7cf0a4ea3b97cacc1802d245fee133ed7a;hp=c5cdc62070b0e833957489f170637dfa226fd973;hpb=1aca77b93853ee127ac3bbf6886f7f04920542ef;p=libs%2Fgui.git diff --git a/source/graphics/windows/window.cpp b/source/graphics/windows/window.cpp index c5cdc62..2af6b83 100644 --- a/source/graphics/windows/window.cpp +++ b/source/graphics/windows/window.cpp @@ -1,3 +1,4 @@ +#define _WIN32_WINNT 0x0601 #include #include #include @@ -22,6 +23,7 @@ LRESULT CALLBACK wndproc_(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) ev.msg = msg; ev.wparam = wparam; ev.lparam = lparam; + ev.extra = GetMessageExtraInfo(); if(wnd && wnd->event(ev)) return 0; } @@ -129,6 +131,21 @@ void Window::warp_pointer(int, int) { } +void Window::platform_set_touch_input() +{ + WORD winver = LOWORD(GetVersion); + if(winver<_WIN32_WINNT) + { + touch_input = false; + throw runtime_error("no touch support"); + } + + if(touch_input) + RegisterTouchWindow(priv->window, 3); // TWF_FINETOUCH|TWF_WANTPALM + else + UnregisterTouchWindow(priv->window); +} + void Window::platform_show() { ShowWindow(priv->window, SW_SHOWNORMAL); @@ -153,11 +170,13 @@ bool Window::event(const Event &evnt) case WM_RBUTTONUP: case WM_MOUSEWHEEL: case WM_MOUSEMOVE: + case WM_TOUCHMOVE: signal_input_event.emit(evnt); break; case WM_SIZE: options.width = LOWORD(evnt.lparam); options.height = HIWORD(evnt.lparam); + resizing = false; signal_resize.emit(options.width, options.height); break; case WM_CLOSE: