Add MOUSE_MODE_CONFINED_HIDDEN
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
This commit is contained in:
parent
f288a79482
commit
98aa3b669e
12 changed files with 69 additions and 37 deletions
|
|
@ -333,8 +333,9 @@ void App::OnPointerMoved(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Co
|
|||
os->input_event(screen_drag);
|
||||
} else {
|
||||
// In case the mouse grabbed, MouseMoved will handle this
|
||||
if (os->get_mouse_mode() == OS::MouseMode::MOUSE_MODE_CAPTURED)
|
||||
if (os->get_mouse_mode() == OS::MouseMode::MOUSE_MODE_CAPTURED) {
|
||||
return;
|
||||
}
|
||||
|
||||
Ref<InputEventMouseMotion> mouse_motion;
|
||||
mouse_motion.instance();
|
||||
|
|
@ -351,8 +352,9 @@ void App::OnPointerMoved(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Co
|
|||
|
||||
void App::OnMouseMoved(MouseDevice ^ mouse_device, MouseEventArgs ^ args) {
|
||||
// In case the mouse isn't grabbed, PointerMoved will handle this
|
||||
if (os->get_mouse_mode() != OS::MouseMode::MOUSE_MODE_CAPTURED)
|
||||
if (os->get_mouse_mode() != OS::MouseMode::MOUSE_MODE_CAPTURED) {
|
||||
return;
|
||||
}
|
||||
|
||||
Windows::Foundation::Point pos;
|
||||
pos.X = last_mouse_pos.X + args->MouseDelta.X;
|
||||
|
|
|
|||
|
|
@ -400,14 +400,12 @@ void OS_UWP::ManagedType::on_gyroscope_reading_changed(Gyrometer ^ sender, Gyrom
|
|||
void OS_UWP::set_mouse_mode(MouseMode p_mode) {
|
||||
if (p_mode == MouseMode::MOUSE_MODE_CAPTURED) {
|
||||
CoreWindow::GetForCurrentThread()->SetPointerCapture();
|
||||
|
||||
} else {
|
||||
CoreWindow::GetForCurrentThread()->ReleasePointerCapture();
|
||||
}
|
||||
|
||||
if (p_mode == MouseMode::MOUSE_MODE_CAPTURED || p_mode == MouseMode::MOUSE_MODE_HIDDEN) {
|
||||
if (p_mode == MouseMode::MOUSE_MODE_HIDDEN || p_mode == MouseMode::MOUSE_MODE_CAPTURED || p_mode == MouseMode::MOUSE_MODE_CONFINED_HIDDEN) {
|
||||
CoreWindow::GetForCurrentThread()->PointerCursor = nullptr;
|
||||
|
||||
} else {
|
||||
CoreWindow::GetForCurrentThread()->PointerCursor = ref new CoreCursor(CoreCursorType::Arrow, 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue