Repository navigation
老板键:每台实例一个全局快捷键藏起 / 叫回窗口,管理器留在托盘 - #131
Merged
Merged
Conversation
# Conflicts: # README.en.md # README.md # internal/cli/commands.go # internal/cli/format.go # internal/emu/status.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs ModAVD/ModAVD#101
为什么
#101 剩下的老板键:每台带窗口的实例一个全局快捷键,按一下藏起、再按一下叫回;藏起来以后任务栏不留按钮,托盘里有管理器的图标。卡片标「无头」已随 0.38.2 发了,这次不动。
改了什么
internal/bosskey):写法Ctrl+Alt+Shift+1,至少带 Ctrl、Alt、Shift 中的一个,不收 Win;按键可以是数字、字母、F1–F24、Num0–Num9、Space、Insert、Delete、Home、End、PageUp、PageDown、方向键。存在instances.<i>.bossKey,空字符串是不要;没写就用默认值:编号 0–9 是 Ctrl+Alt+Shift+编号,超过 9 没有,已有实例不用迁移。写坏的值当作不要。InstanceInfo.boss_key。UpdateRequest.BossKey:先校验再写,键不对时同一请求里的其他设置也不写;只有 Windows,别的平台报 unsupported。BossKeyTargets:只看进程和实例文件,不走 adb。ToggleBossKey:这个键管的带窗口实例里,有一台显示着就全藏,全藏着就全显示。看IsWindowVisible,不管是谁藏的;藏 / 显复用SetWindowVisible,和window show|hide是同一套。ShowHiddenWindows:给托盘点击和退出用。EmulatorWindowsShown。Tray:一个不显示的顶层窗口,在锁定的 OS 线程上跑消息循环。RegisterHotKey和UnregisterHotKey也放到这个线程上调,因为热键属于窗口所在的线程。Shell_NotifyIconW,Explorer 重启后按 TaskbarCreated 补回)。GET /api/boss-keys、POST /api/boss-keys/check(当场试注册、马上注销)。PATCH /api/instances/{i}收boss_key,回boss_key_taken。set <i> --boss-key <组合>|none,info显示老板键,JSON 是boss_key。window的说明里加了老板键。MCP 不加。set --boss-key,API.md/API.en.md加接口和「老板键和托盘」一节。update install的提示从「关掉管理器窗口」改成「关掉管理器(包括托盘里的)」,因为关窗口已经不会让管理器退出了。测试
bosskey:默认键、解析(大小写、空格、Win、重复、没修饰键、不认识的键)、none和清空、instances.<i>.bossKey各种写法。emu:ShowHiddenWindows。win:RegisterHotKey(用没人用的 Ctrl+Alt+Shift+F23):注册、试注册、被占时报 1409、Close后释放。WM_HOTKEY能回调。EmulatorWindowsShown配假 Qt 窗口。ui(假托盘):taken,放开后注册上;失败只记一次日志。check/PATCH的boss_key_taken。cli:set --boss-key、info。scripts/test_create_cancel.mjs):按键转组合、试注册、警告图标、清空、保存、不支持时隐藏。原有诊断模式的用例照旧过。go vet ./...(含 darwin/arm64、linux/amd64)、go test ./...、gofmt、node 测试、隐私扫描都过了。WM_HOTKEY):WM_HOTKEY藏 / 显:一台单独用一个键,再测几台同一个键。