Refactor and implement runtime session management

- Removed the UnitSelector class from UI and added a new UnitSelector class in Modules.
- Introduced RuntimeSessionCoordinator to manage runtime sessions, ensuring safe concurrent operations.
- Created ShigureRuntimeFactory to handle the creation of ShigureRuntime instances.
- Added WindowsTriggerKeyState and WindowsVirtualKeyMap for handling key states and virtual key mappings.
- Implemented IKeymapResolver interface for key mapping resolution.
- Established runtime dependencies with interfaces for screen scanning, state building, logic evaluation, and key output.
This commit is contained in:
waynebian01
2026-08-06 01:17:28 +08:00
parent b91298e669
commit 5a00da85d5
20 changed files with 1075 additions and 349 deletions

View File

@@ -0,0 +1,8 @@
namespace Shigure;
internal sealed class WindowsTriggerKeyState : ITriggerKeyState
{
public int? ResolveVirtualKey(string keyName) => WindowsVirtualKeyMap.Resolve(keyName);
public bool IsPressed(int virtualKey) => NativeMethods.IsKeyDown(virtualKey);
}