Add Touch events for win32. (#377)

* Add Touch events for win32.

* Add entry to CHANGELOG.md
This commit is contained in:
cpardotortosa 2018-04-05 21:25:37 +02:00 committed by Francesca Frangipane
parent 1c4973d5b7
commit 580321b56f
3 changed files with 47 additions and 1 deletions

View file

@ -473,6 +473,15 @@ unsafe fn init(window: WindowAttributes, pl_attribs: PlatformSpecificWindowBuild
winuser::RegisterRawInputDevices(&rid, 1, mem::size_of::<winuser::RAWINPUTDEVICE>() as u32);
}
// Register for touch events if applicable
{
let digitizer = winuser::GetSystemMetrics( winuser::SM_DIGITIZER ) as u32;
if digitizer & winuser::NID_READY != 0 {
winuser::RegisterTouchWindow( real_window.0, winuser::TWF_WANTPALM );
}
}
// Creating a mutex to track the current window state
let window_state = Arc::new(Mutex::new(events_loop::WindowState {
cursor: winuser::IDC_ARROW, // use arrow by default