feat(desktop): built-in Han/Eng layout auto-switching, terminal/Vim support, and Unicode input
This commit is contained in:
parent
1da04b9e46
commit
a3ac44da2b
109 changed files with 8234 additions and 242 deletions
|
|
@ -122,7 +122,9 @@ export class TextInsertService extends EventEmitter {
|
|||
)
|
||||
}
|
||||
// 앱이 지우기를 처리할 시간 — 붙여넣기가 지우기보다 먼저 처리되면 순서가 꼬인다.
|
||||
await this._sleep(15)
|
||||
// 긴 문장 교정(예: 30~40자 백스페이스)에서는 대상 앱 메시지 큐가 백스페이스를 소화할 시간을 비례해서 준다.
|
||||
const settleMs = Math.min(90, Math.max(20, deleteCount * 2))
|
||||
await this._sleep(settleMs)
|
||||
return this._insertNow(text, method)
|
||||
})
|
||||
this._tail = run.then(
|
||||
|
|
@ -195,9 +197,10 @@ export class TextInsertService extends EventEmitter {
|
|||
// 3. Paste 단축키 시뮬레이션 — 플랫폼별 modifier
|
||||
await this._keyboard.paste()
|
||||
|
||||
// 4. 붙여넣기 완료 대기 — 앱이 paste 이벤트를 처리할 시간
|
||||
// macOS는 비동기 처리가 좀 더 느린 경우가 있어 250ms로 잡음
|
||||
await this._sleep(this._platform === 'darwin' ? 250 : 150)
|
||||
// 4. 붙여넣기 완료 대기 — 대상 앱의 메시지 큐가 백스페이스 뒤 WM_PASTE(Ctrl+V)에서
|
||||
// 클립보드를 읽을 때까지 충분히 기다린 뒤 클립보드를 복원/비운다.
|
||||
// (Ctrl+V 키 이벤트는 이미 위에서 전송되었으므로 화면 반영은 즉시 일어난다.)
|
||||
await this._sleep(250)
|
||||
|
||||
// 5. 클립보드 복원 (원래 내용으로 되돌림)
|
||||
if (this._restoreIfStillOurs(text, snapshot)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue