diff --git a/stardew-access/ModEntry.cs b/stardew-access/ModEntry.cs
index 87a98e9..224fcf6 100644
--- a/stardew-access/ModEntry.cs
+++ b/stardew-access/ModEntry.cs
@@ -5,6 +5,7 @@ using StardewValley;
using HarmonyLib;
using stardew_access.Patches;
using AutoHotkey.Interop;
+using System.Runtime.InteropServices;
namespace stardew_access
{
@@ -38,18 +39,8 @@ namespace stardew_access
Game1.options.setGamepadMode("force_on");
// Initialize AutoHotKey
- try
- {
- ahk = AutoHotkeyEngine.Instance;
- ahk.ExecRaw("[::\nSend {LButton}");
- ahk.ExecRaw("^Enter::\nSend {LButton}");
- ahk.ExecRaw("]::\nSend {RButton}");
- ahk.ExecRaw("+Enter::\nSend {RButton}");
- }
- catch (Exception e)
- {
- monitor.Log($"Unable to initialize AutoHotKey:\n{e.Message}\n{e.StackTrace}", LogLevel.Error);
- }
+ if(RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ InitializeAutoHotKey();
screenReader = new ScreenReader();
screenReader.InitializeScreenReader();
@@ -148,5 +139,21 @@ namespace stardew_access
monitor.Log($"{Game1.player.controller.pathToEndPoint==null}", LogLevel.Debug); // true if path not found
}*/
}
+
+ private void InitializeAutoHotKey()
+ {
+ try
+ {
+ ahk = AutoHotkeyEngine.Instance;
+ ahk.ExecRaw("[::\nSend {LButton}");
+ ahk.ExecRaw("^Enter::\nSend {LButton}");
+ ahk.ExecRaw("]::\nSend {RButton}");
+ ahk.ExecRaw("+Enter::\nSend {RButton}");
+ }
+ catch (Exception e)
+ {
+ monitor.Log($"Unable to initialize AutoHotKey:\n{e.Message}\n{e.StackTrace}", LogLevel.Error);
+ }
+ }
}
}
\ No newline at end of file
diff --git a/stardew-access/ScreenReader.cs b/stardew-access/ScreenReader.cs
index 76e04ba..c5f351d 100644
--- a/stardew-access/ScreenReader.cs
+++ b/stardew-access/ScreenReader.cs
@@ -1,5 +1,6 @@
using AccessibleOutput;
using StardewModdingAPI;
+using System.Runtime.InteropServices;
namespace stardew_access
{
@@ -11,6 +12,9 @@ namespace stardew_access
/// Initializes the screen reader.
public void InitializeScreenReader()
{
+ if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ return;
+
NvdaOutput? nvdaOutput = null;
JawsOutput? jawsOutput = null;
SapiOutput? sapiOutput = null;
diff --git a/stardew-access/stardew-access.csproj b/stardew-access/stardew-access.csproj
index cd68d76..a024c46 100644
--- a/stardew-access/stardew-access.csproj
+++ b/stardew-access/stardew-access.csproj
@@ -7,6 +7,7 @@
enable
preview
AnyCPU
+ true