diff options
author | tomaka <pierre.krieger1708@gmail.com> | 2015-12-30 08:45:11 +0100 |
---|---|---|
committer | tomaka <pierre.krieger1708@gmail.com> | 2015-12-30 08:45:11 +0100 |
commit | 8236564a5224e38cd6e345df8ffaf343bfa24320 (patch) | |
tree | 30246ebab1edfca843232b1d66ab17c5908a411e /src/api | |
parent | ff0614b61f7c5544829a36b41236da2ab4b583ab (diff) | |
parent | 47d9a7f1a6ded7bfe549c6c39525767eaa6ff87a (diff) | |
download | glutin-8236564a5224e38cd6e345df8ffaf343bfa24320.tar.gz glutin-8236564a5224e38cd6e345df8ffaf343bfa24320.zip |
Merge pull request #687 from Aceeri/master
Support for side buttons on mouse
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/win32/callback.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/api/win32/callback.rs b/src/api/win32/callback.rs index d879da5..0215c9f 100644 --- a/src/api/win32/callback.rs +++ b/src/api/win32/callback.rs @@ -212,6 +212,24 @@ pub unsafe extern "system" fn callback(window: winapi::HWND, msg: winapi::UINT, 0 }, + winapi::WM_XBUTTONDOWN => { + use events::Event::MouseInput; + use events::MouseButton::Other; + use events::ElementState::Pressed; + let xbutton = winapi::HIWORD(wparam as winapi::DWORD) as winapi::c_int; // waiting on PR for winapi to add GET_XBUTTON_WPARAM + send_event(window, MouseInput(Pressed, Other(xbutton as u8))); + 0 + }, + + winapi::WM_XBUTTONUP => { + use events::Event::MouseInput; + use events::MouseButton::Other; + use events::ElementState::Released; + let xbutton = winapi::HIWORD(wparam as winapi::DWORD) as winapi::c_int; + send_event(window, MouseInput(Released, Other(xbutton as u8))); + 0 + }, + winapi::WM_INPUT => { let mut data: winapi::RAWINPUT = mem::uninitialized(); let mut data_size = mem::size_of::<winapi::RAWINPUT>() as winapi::UINT; |