fix(SelectionAssistant): support selection when alt key pressed (#6865)

fix: support alt key selection
This commit is contained in:
fullex 2025-06-06 08:29:00 +08:00 committed by GitHub
parent 89d68c6eb2
commit dad9873529
3 changed files with 13 additions and 8 deletions

View File

@ -92,7 +92,7 @@
"officeparser": "^4.1.1",
"os-proxy-config": "^1.1.2",
"proxy-agent": "^6.5.0",
"selection-hook": "^0.9.21",
"selection-hook": "^0.9.22",
"tar": "^7.4.3",
"turndown": "^7.2.0",
"webdav": "^5.8.0",

View File

@ -812,8 +812,8 @@ export class SelectionService {
if (this.triggerMode === TriggerMode.Ctrlkey && this.isCtrlkey(data.vkCode)) {
return
}
//dont hide toolbar when shiftkey is pressed, because it's used for selection
if (this.isShiftkey(data.vkCode)) {
//dont hide toolbar when shiftkey or altkey is pressed, because it's used for selection
if (this.isShiftkey(data.vkCode) || this.isAltkey(data.vkCode)) {
return
}
@ -901,6 +901,11 @@ export class SelectionService {
return vkCode === 160 || vkCode === 161
}
//check if the key is alt key
private isAltkey(vkCode: number) {
return vkCode === 164 || vkCode === 165
}
/**
* Create a preloaded action window for quick response
* Action windows handle specific operations on selected text

View File

@ -5667,7 +5667,7 @@ __metadata:
remark-math: "npm:^6.0.0"
rollup-plugin-visualizer: "npm:^5.12.0"
sass: "npm:^1.88.0"
selection-hook: "npm:^0.9.21"
selection-hook: "npm:^0.9.22"
shiki: "npm:^3.4.2"
string-width: "npm:^7.2.0"
styled-components: "npm:^6.1.11"
@ -16384,13 +16384,13 @@ __metadata:
languageName: node
linkType: hard
"selection-hook@npm:^0.9.21":
version: 0.9.21
resolution: "selection-hook@npm:0.9.21"
"selection-hook@npm:^0.9.22":
version: 0.9.22
resolution: "selection-hook@npm:0.9.22"
dependencies:
node-gyp: "npm:latest"
node-gyp-build: "npm:^4.8.4"
checksum: 10c0/e458f8d37c049899e0f9450ca29f882ee01e11b15490f7ee2ddd088843e3e9a201fd5410083faebfbf11e1259a2a74b0b736ff8f1789b626a21ea48ef0ca8705
checksum: 10c0/4a202485fc4aed250f4ab863fdca9235240d49e5629549f5cf72dd3087af81ee54d65c28fa7d215d7ca609e25132b125e10540acbab1f6f4a7d8a508e1468ea3
languageName: node
linkType: hard