From 15cc0f4280d2414cc2654029e19fee243cfcc510 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 7 Jul 2023 01:39:19 +0900 Subject: [PATCH] ebiten: update comments --- run.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/run.go b/run.go index abc81050d..b6a845bbd 100644 --- a/run.go +++ b/run.go @@ -353,8 +353,13 @@ func CursorMode() CursorModeType { // CursorModeCaptured also works on browsers. // When the user exits the captured mode not by SetCursorMode but by the UI (e.g., pressing ESC), // the previous cursor mode is set automatically. +// // On browsers, setting CursorModeCaptured might be delayed especially just after escaping from a capture. // +// On browsers, capturing a cursor requires a user gesture, otherwise SetCursorMode does nothing but leave an error message in console. +// This behavior varies across browser implementations. +// Check a user interaction before calling capturing a cursor e.g. by IsMouseButtonPressed or IsKeyPressed. +// // SetCursorMode does nothing on mobiles. // // SetCursorMode is concurrent-safe. @@ -395,8 +400,9 @@ func IsFullscreen() bool { // On desktops, Ebitengine uses 'windowed' fullscreen mode, which doesn't change // your monitor's resolution. // -// On browsers, triggering fullscreen requires a user gesture otherwise SetFullscreen does nothing but leave an error message in console. -// This behaviour varies across browser implementations, your mileage may vary. +// On browsers, triggering fullscreen requires a user gesture, otherwise SetFullscreen does nothing but leave an error message in console. +// This behavior varies across browser implementations. +// Check a user interaction before triggering fullscreen e.g. by IsMouseButtonPressed or IsKeyPressed. // // SetFullscreen does nothing on mobiles. //