mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-23 22:01:31 +11:00
Implement focus events for win32
This commit is contained in:
parent
0103fb833e
commit
7a8e7a7922
|
@ -305,12 +305,14 @@ pub static WM_COMMAND: UINT = 0x0111;
|
||||||
pub static WM_DESTROY: UINT = 0x0002;
|
pub static WM_DESTROY: UINT = 0x0002;
|
||||||
pub static WM_KEYDOWN: UINT = 0x0100;
|
pub static WM_KEYDOWN: UINT = 0x0100;
|
||||||
pub static WM_KEYUP: UINT = 0x0101;
|
pub static WM_KEYUP: UINT = 0x0101;
|
||||||
|
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_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;
|
||||||
|
pub static WM_SETFOCUS: UINT = 0x0007;
|
||||||
pub static WM_SIZE: UINT = 0x0005;
|
pub static WM_SIZE: UINT = 0x0005;
|
||||||
pub static WM_SIZING: UINT = 0x0214;
|
pub static WM_SIZING: UINT = 0x0214;
|
||||||
|
|
||||||
|
|
|
@ -395,6 +395,18 @@ extern "stdcall" fn callback(window: ffi::HWND, msg: ffi::UINT,
|
||||||
0
|
0
|
||||||
},
|
},
|
||||||
|
|
||||||
|
ffi::WM_SETFOCUS => {
|
||||||
|
use events::Focused;
|
||||||
|
send_event(window, Focused(true));
|
||||||
|
0
|
||||||
|
},
|
||||||
|
|
||||||
|
ffi::WM_KILLFOCUS => {
|
||||||
|
use events::Focused;
|
||||||
|
send_event(window, Focused(false));
|
||||||
|
0
|
||||||
|
},
|
||||||
|
|
||||||
_ => unsafe {
|
_ => unsafe {
|
||||||
ffi::DefWindowProcW(window, msg, wparam, lparam)
|
ffi::DefWindowProcW(window, msg, wparam, lparam)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue