Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,38 @@ jobs:
with:
go-version: 'stable'

- name: Resolve MaaFramework Release
id: resolve_maa_release
uses: actions/github-script@v9
env:
TARGET_REPOSITORY: MaaXYZ/MaaFramework
with:
result-encoding: string
script: |
const repository = process.env.TARGET_REPOSITORY
const [owner, repo] = repository.split('/')
const releases = await github.paginate(github.rest.repos.listReleases, {
owner,
repo,
per_page: 100,
})

const latestRelease = releases.find(release => !release.draft)
if (!latestRelease) {
core.setFailed(`No published release found for ${repository}`)
return ''
}

core.info(
`Resolved MaaFramework release: ${latestRelease.tag_name} (prerelease=${latestRelease.prerelease})`
)
return latestRelease.tag_name

- name: Download MaaFramework
uses: robinraju/release-downloader@v1
with:
repository: MaaXYZ/MaaFramework
latest: true
preRelease: true
tag: ${{ steps.resolve_maa_release.outputs.result }}
fileName: "${{ env.MAA_FILE_PREFIX }}-${{ env.ARCH }}*"
out-file-path: "deps"
extract: true
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@
**移除构造函数**:`NewCarouselImageController` 已移除。若仅需空操作控制器,请使用 `NewBlankController()`;若需基于录制数据回放,请使用 `NewReplayController(recordingPath)`,录制入口为 `NewRecordController(inner, recordingPath)`。
**新增**:`SetScreenshot(opts ...ScreenshotOption) error` 与配套选项函数;新增 `WithScreenshotResizeMethod(...)` / `ScreenshotResizeMethod*` 常量,以及 `SetMouseLockFollow(enabled bool) error`
**新增控制器构造函数**:`NewMacOSController(...)`、`NewAndroidNativeController(...)`、`NewReplayController(...)`、`NewRecordController(...)`
**接口变更**:`CustomController` 接口新增 `RelativeMove(dx, dy int32) bool`、`Shell(cmd string, timeout int64) (string, bool)`、`GetInfo() (string, bool)` 必须实现方法。已有实现若无需支持,可返回 no-op 成功值
**接口变更**:
- `CustomController` 接口新增 `RelativeMove(dx, dy int32) bool`、`Shell(cmd string, timeout int64) (string, bool)`、`GetInfo() (string, bool)` 必须实现方法。已有实现若无需支持,可返回 no-op 成功值
- WlRoots 支持将按键视为 Win32 VK 键码:`NewWlRootsController(wlrSocketPath string, useWin32VkCode bool)`
**Win32 InputMethod 命名对齐**:
- `InputSendMessageWithCursorPosAndBlockInput` → `InputSendMessageWithWindowPos`
- `InputPostMessageWithCursorPosAndBlockInput` → `InputPostMessageWithWindowPos`
Expand Down
3 changes: 2 additions & 1 deletion controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ func NewWin32Controller(
// NewWlRootsController creates a WlRoots controller instance.
func NewWlRootsController(
wlrSocketPath string,
useWin32VkCode bool,
) (*Controller, error) {
handle := native.MaaWlRootsControllerCreate(wlrSocketPath)
handle := native.MaaWlRootsControllerCreate(wlrSocketPath, useWin32VkCode)
if handle == 0 {
return nil, errors.New("failed to create WlRoots controller")
}
Expand Down
2 changes: 1 addition & 1 deletion internal/native/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ var (
MaaAdbControllerCreate func(adbPath, address string, screencapMethods uint64, inputMethods uint64, config, agentPath string) uintptr
MaaPlayCoverControllerCreate func(address, uuid string) uintptr
MaaWin32ControllerCreate func(hWnd unsafe.Pointer, screencapMethods uint64, mouseMethod, keyboardMethod uint64) uintptr
MaaWlRootsControllerCreate func(wlrSocketPath string) uintptr
MaaWlRootsControllerCreate func(wlrSocketPath string, useWin32VkCode bool) uintptr
MaaCustomControllerCreate func(controller unsafe.Pointer, controllerArg uintptr) uintptr
MaaGamepadControllerCreate func(hWnd unsafe.Pointer, gamepadType MaaGamepadType, screencapMethod uint64) uintptr
MaaMacOSControllerCreate func(windowID uint32, screencapMethod MaaMacOSScreencapMethod, inputMethod MaaMacOSInputMethod) uintptr
Expand Down
Loading