Setup for linux
parent
3744929be0
commit
c68b113b08
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
using AccessibleOutput;
|
||||
using StardewModdingAPI;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace stardew_access
|
||||
{
|
||||
|
@ -11,6 +12,9 @@ namespace stardew_access
|
|||
/// <summary>Initializes the screen reader.</summary>
|
||||
public void InitializeScreenReader()
|
||||
{
|
||||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
return;
|
||||
|
||||
NvdaOutput? nvdaOutput = null;
|
||||
JawsOutput? jawsOutput = null;
|
||||
SapiOutput? sapiOutput = null;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<Nullable>enable</Nullable>
|
||||
<LangVersion>preview</LangVersion>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
Loading…
Reference in New Issue