mirror of
https://github.com/rust-windowing/winit.git
synced 2026-09-02 14:50:04 -04:00
Add moved events for win32
This commit is contained in:
@@ -7,6 +7,9 @@ pub enum Event {
|
|||||||
/// The size of the window has changed.
|
/// The size of the window has changed.
|
||||||
SizeChanged(uint, uint),
|
SizeChanged(uint, uint),
|
||||||
|
|
||||||
|
/// The position of the window has changed.
|
||||||
|
Moved(uint, uint),
|
||||||
|
|
||||||
/// The window has been closed.
|
/// The window has been closed.
|
||||||
Closed,
|
Closed,
|
||||||
|
|
||||||
|
|||||||
@@ -309,6 +309,7 @@ pub static WM_KILLFOCUS: UINT = 0x0008;
|
|||||||
pub static WM_MBUTTONDOWN: UINT = 0x0207;
|
pub static WM_MBUTTONDOWN: UINT = 0x0207;
|
||||||
pub static WM_MBUTTONUP: UINT = 0x0208;
|
pub static WM_MBUTTONUP: UINT = 0x0208;
|
||||||
pub static WM_MOUSEMOVE: UINT = 0x0200;
|
pub static WM_MOUSEMOVE: UINT = 0x0200;
|
||||||
|
pub static WM_MOVE: UINT = 0x0003;
|
||||||
pub static WM_PAINT: UINT = 0x000F;
|
pub static WM_PAINT: UINT = 0x000F;
|
||||||
pub static WM_RBUTTONDOWN: UINT = 0x0204;
|
pub static WM_RBUTTONDOWN: UINT = 0x0204;
|
||||||
pub static WM_RBUTTONUP: UINT = 0x0205;
|
pub static WM_RBUTTONUP: UINT = 0x0205;
|
||||||
|
|||||||
@@ -299,6 +299,14 @@ extern "stdcall" fn callback(window: ffi::HWND, msg: ffi::UINT,
|
|||||||
0
|
0
|
||||||
},
|
},
|
||||||
|
|
||||||
|
ffi::WM_MOVE => {
|
||||||
|
use events::Moved;
|
||||||
|
let x = ffi::LOWORD(lparam as ffi::DWORD) as uint;
|
||||||
|
let y = ffi::HIWORD(lparam as ffi::DWORD) as uint;
|
||||||
|
send_event(window, Moved(x, y));
|
||||||
|
0
|
||||||
|
},
|
||||||
|
|
||||||
ffi::WM_CHAR => {
|
ffi::WM_CHAR => {
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use events::ReceivedCharacter;
|
use events::ReceivedCharacter;
|
||||||
|
|||||||
Reference in New Issue
Block a user