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 aa3c376def
commit dfc32967ed
3 changed files with 13 additions and 8 deletions
+7 -2
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