account for escape key on web
This commit is contained in:
parent
9322ad0f9b
commit
0e4b1758cc
|
|
@ -674,8 +674,6 @@ void EnableCursor(void)
|
||||||
|
|
||||||
// Set cursor position in the middle
|
// Set cursor position in the middle
|
||||||
SetMousePosition(CORE.Window.screen.width/2, CORE.Window.screen.height/2);
|
SetMousePosition(CORE.Window.screen.width/2, CORE.Window.screen.height/2);
|
||||||
|
|
||||||
CORE.Input.Mouse.cursorHidden = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disables cursor (lock cursor)
|
// Disables cursor (lock cursor)
|
||||||
|
|
@ -686,8 +684,10 @@ void DisableCursor(void)
|
||||||
|
|
||||||
// Set cursor position in the middle
|
// Set cursor position in the middle
|
||||||
SetMousePosition(CORE.Window.screen.width/2, CORE.Window.screen.height/2);
|
SetMousePosition(CORE.Window.screen.width/2, CORE.Window.screen.height/2);
|
||||||
|
}
|
||||||
|
|
||||||
CORE.Input.Mouse.cursorHidden = true;
|
bool IsCursorHidden(void) {
|
||||||
|
return EM_ASM_INT({ return document.pointerLockElement !== null; }) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Swap back buffer with front buffer (screen drawing)
|
// Swap back buffer with front buffer (screen drawing)
|
||||||
|
|
|
||||||
|
|
@ -790,10 +790,12 @@ void DisableEventWaiting(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if cursor is not visible
|
// Check if cursor is not visible
|
||||||
|
#if !defined(PLATFORM_WEB)
|
||||||
bool IsCursorHidden(void)
|
bool IsCursorHidden(void)
|
||||||
{
|
{
|
||||||
return CORE.Input.Mouse.cursorHidden;
|
return CORE.Input.Mouse.cursorHidden;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Check if cursor is on the current screen.
|
// Check if cursor is on the current screen.
|
||||||
bool IsCursorOnScreen(void)
|
bool IsCursorOnScreen(void)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user