根本原因: 2.0.13 的事件紀錄證實:鎖定螢幕再解鎖後,renderer 只收得到 mouseup 與 mousemove,左右鍵的 mousedown 全部被吃掉,直到重啟才恢復(符合 Windows 對 永不啟用視窗的 WM_MOUSEACTIVATE 回傳 MA_NOACTIVATEANDEAT 的行為,只丟掉按下 那一則訊息)。而左鍵靠 mousedown 設 pressed、右鍵靠 mousedown 開選單,兩者 因此同時失效。 影響: 每次鎖定/解鎖後寵物就不能拖曳、不能右鍵,只能重啟。 修法: 右鍵選單改在 mouseup 開(也是 Windows 慣例);mousemove 的 buttons 位元帶著 「左鍵按著」而沒有 pressed 時補一個 synthetic pressed,拖曳照常;沒有 mousedown 的左鍵 mouseup 當成單擊。補上對應單元測試與 README 說明。 版號 2.0.14。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
91 lines
2.3 KiB
JSON
91 lines
2.3 KiB
JSON
{
|
||
"name": "claude-pet",
|
||
"version": "2.0.14",
|
||
"description": "Codex Pets 相容的 Claude Code 桌面寵物(spriteVersionNumber 2:9 個動作列 + 16 方向追視)",
|
||
"main": "main.js",
|
||
"private": true,
|
||
"scripts": {
|
||
"start": "electron .",
|
||
"hooks:install": "node scripts/install-hooks.js",
|
||
"hooks:uninstall": "node scripts/uninstall-hooks.js",
|
||
"autostart:install": "node scripts/autostart.js install",
|
||
"autostart:uninstall": "node scripts/autostart.js uninstall",
|
||
"autostart:status": "node scripts/autostart.js status",
|
||
"predist": "npm version patch --no-git-tag-version",
|
||
"dist": "electron-builder --win",
|
||
"pack": "electron-builder --win --dir",
|
||
"release": "node scripts/release.js",
|
||
"predist:portable": "npm version patch --no-git-tag-version",
|
||
"dist:portable": "electron-builder --win portable"
|
||
},
|
||
"devDependencies": {
|
||
"electron": "^43.4.1",
|
||
"electron-builder": "^26.0.12"
|
||
},
|
||
"author": "JianMiau",
|
||
"build": {
|
||
"appId": "com.jianmiau.claude-pet",
|
||
"productName": "Claude Pet",
|
||
"copyright": "JianMiau",
|
||
"directories": {
|
||
"output": "dist",
|
||
"buildResources": "build"
|
||
},
|
||
"files": [
|
||
"main.js",
|
||
"preload.js",
|
||
"renderer/**/*",
|
||
"lib/**/*",
|
||
"hook/**/*",
|
||
"package.json"
|
||
],
|
||
"asarUnpack": [
|
||
"hook/**/*"
|
||
],
|
||
"win": {
|
||
"target": [
|
||
{
|
||
"target": "nsis",
|
||
"arch": [
|
||
"x64"
|
||
]
|
||
},
|
||
{
|
||
"target": "portable",
|
||
"arch": [
|
||
"x64"
|
||
]
|
||
},
|
||
{
|
||
"target": "zip",
|
||
"arch": [
|
||
"x64"
|
||
]
|
||
}
|
||
],
|
||
"icon": "build/icon.ico"
|
||
},
|
||
"nsis": {
|
||
"oneClick": false,
|
||
"perMachine": false,
|
||
"allowToChangeInstallationDirectory": true,
|
||
"createDesktopShortcut": true,
|
||
"createStartMenuShortcut": true,
|
||
"shortcutName": "Claude Pet",
|
||
"deleteAppDataOnUninstall": false,
|
||
"artifactName": "${productName}-${version}-setup.${ext}"
|
||
},
|
||
"portable": {
|
||
"artifactName": "${productName}-${version}-portable.${ext}",
|
||
"unpackDirName": "ClaudePet",
|
||
"requestExecutionLevel": "user"
|
||
},
|
||
"extraFiles": [
|
||
{
|
||
"from": "pets",
|
||
"to": "pets"
|
||
}
|
||
]
|
||
}
|
||
}
|