Fix(macOS): restore dblclick for MAC touch, fix scroll speed (10px→40px per notch)

This commit is contained in:
yuanyuanxiang
2026-06-04 15:33:12 +02:00
parent be09b271e1
commit fc0be64880
3 changed files with 15 additions and 10 deletions

View File

@@ -3667,13 +3667,15 @@
// Must send first click before dblclick for Windows to recognize
console.log('[Touch] Double click');
clickAtCursor(0); // First click
// dblClickAtCursor(); // Then double click
// 强制人工延迟 20 毫秒发送第二次标准单击
// 这 20ms 的延迟在操作上完全感觉不到,但对远程桌面的网络和操作系统驱动至关重要!
// 它能完美地把两次点击在时间线上拉开,让任何操作系统都 100% 判定这是标准的“物理鼠标双击”。
setTimeout(() => {
clickAtCursor(0);
}, 20);
if (currentDevice && currentDevice.clientType === 'MAC') {
// macOS uses a real dblclick event; two sequential clicks don't work
dblClickAtCursor(); // Then double click
} else {
// Windows/Linux: simulate physical double-click with two clicks 20ms apart
setTimeout(() => {
clickAtCursor(0);
}, 20);
}
touchState.state = T_IDLE;
} else if (touchState.state === T_FIRST_DOWN && !touchState.moved) {
// First tap released without moving = single click