Fix(macOS): restore dblclick for MAC touch, fix scroll speed (10px→40px per notch)
This commit is contained in:
@@ -217,9 +217,9 @@ void InputHandler::handleMouseWheel(int delta)
|
|||||||
{
|
{
|
||||||
// Convert Windows wheel delta (120 = one notch) to macOS pixel units
|
// Convert Windows wheel delta (120 = one notch) to macOS pixel units
|
||||||
// Using pixel units provides smoother scrolling than line units
|
// Using pixel units provides smoother scrolling than line units
|
||||||
// Windows: 120 = one standard notch
|
// Windows: 120 = one standard notch (~3 lines * 20px = ~60px)
|
||||||
// macOS: approximately 10 pixels per notch feels natural
|
// macOS: 40 pixels per notch matches Windows scroll feel
|
||||||
int32_t scrollAmount = (delta * 10) / 120;
|
int32_t scrollAmount = (delta * 40) / 120;
|
||||||
|
|
||||||
// Use pixel units for smoother scrolling experience
|
// Use pixel units for smoother scrolling experience
|
||||||
CGEventRef event = CGEventCreateScrollWheelEvent(
|
CGEventRef event = CGEventCreateScrollWheelEvent(
|
||||||
|
|||||||
@@ -1600,6 +1600,9 @@ std::string CWebService::BuildDeviceListJson(const std::string& username) {
|
|||||||
device["screen"] = AnsiToUtf8(resolution); // e.g. "2:3840x1080"
|
device["screen"] = AnsiToUtf8(resolution); // e.g. "2:3840x1080"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CString clientType = ctx->GetAdditionalData(RES_CLIENT_TYPE);
|
||||||
|
device["clientType"] = AnsiToUtf8(clientType); // e.g. "MAC", "LNX", "EXE"
|
||||||
|
|
||||||
res["devices"].append(device);
|
res["devices"].append(device);
|
||||||
}
|
}
|
||||||
LeaveCriticalSection(&m_pParentDlg->m_cs);
|
LeaveCriticalSection(&m_pParentDlg->m_cs);
|
||||||
|
|||||||
@@ -3667,13 +3667,15 @@
|
|||||||
// Must send first click before dblclick for Windows to recognize
|
// Must send first click before dblclick for Windows to recognize
|
||||||
console.log('[Touch] Double click');
|
console.log('[Touch] Double click');
|
||||||
clickAtCursor(0); // First click
|
clickAtCursor(0); // First click
|
||||||
// dblClickAtCursor(); // Then double click
|
if (currentDevice && currentDevice.clientType === 'MAC') {
|
||||||
// 强制人工延迟 20 毫秒发送第二次标准单击
|
// macOS uses a real dblclick event; two sequential clicks don't work
|
||||||
// 这 20ms 的延迟在操作上完全感觉不到,但对远程桌面的网络和操作系统驱动至关重要!
|
dblClickAtCursor(); // Then double click
|
||||||
// 它能完美地把两次点击在时间线上拉开,让任何操作系统都 100% 判定这是标准的“物理鼠标双击”。
|
} else {
|
||||||
|
// Windows/Linux: simulate physical double-click with two clicks 20ms apart
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
clickAtCursor(0);
|
clickAtCursor(0);
|
||||||
}, 20);
|
}, 20);
|
||||||
|
}
|
||||||
touchState.state = T_IDLE;
|
touchState.state = T_IDLE;
|
||||||
} else if (touchState.state === T_FIRST_DOWN && !touchState.moved) {
|
} else if (touchState.state === T_FIRST_DOWN && !touchState.moved) {
|
||||||
// First tap released without moving = single click
|
// First tap released without moving = single click
|
||||||
|
|||||||
Reference in New Issue
Block a user