Skip to content

Commit 7f826fb

Browse files
committed
FNA_MOUSE_DISABLE_GLOBAL_ACCESS
1 parent e69b6b3 commit 7f826fb

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

src/FNAPlatform/FNAPlatform.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ static FNAPlatform()
9292
"1"
9393
);
9494
}
95+
if (args.TryGetValue("disableglobalmouse", out arg) && arg == "1")
96+
{
97+
Environment.SetEnvironmentVariable(
98+
"FNA_MOUSE_DISABLE_GLOBAL_ACCESS",
99+
"1"
100+
);
101+
}
95102
if (args.TryGetValue("nukesteaminput", out arg) && arg == "1")
96103
{
97104
Environment.SetEnvironmentVariable(

src/FNAPlatform/SDL2_FNAPlatform.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,11 @@ public static string ProgramInit(LaunchParameters args)
237237
SupportsGlobalMouse = ( OSVersion.Equals("Windows") ||
238238
OSVersion.Equals("Mac OS X") ||
239239
videoDriver.Equals("x11") );
240+
if (Environment.GetEnvironmentVariable("FNA_MOUSE_DISABLE_GLOBAL_ACCESS") == "1")
241+
{
242+
// Ignore previous instructions
243+
SupportsGlobalMouse = false;
244+
}
240245

241246
// Only iOS and Android care about device orientation.
242247
SupportsOrientations = ( OSVersion.Equals("iOS") ||

src/FNAPlatform/SDL3_FNAPlatform.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,11 @@ public static string ProgramInit(LaunchParameters args)
207207
SupportsGlobalMouse = ( OSVersion.Equals("Windows") ||
208208
OSVersion.Equals("macOS") ||
209209
videoDriver.Equals("x11") );
210+
if (Environment.GetEnvironmentVariable("FNA_MOUSE_DISABLE_GLOBAL_ACCESS") == "1")
211+
{
212+
// Ignore previous instructions
213+
SupportsGlobalMouse = false;
214+
}
210215

211216
/* SDL3 added a helper to try and override constant warping
212217
* with emulation via relative mouse mode; this is nice

0 commit comments

Comments
 (0)