mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-02-17 14:07:28 +08:00
Add trackpad support documentation for iOS edge swipe gesture
Co-authored-by: rustdesk <71636191+rustdesk@users.noreply.github.com>
This commit is contained in:
@@ -201,6 +201,7 @@ class _TerminalPageState extends State<TerminalPage>
|
||||
);
|
||||
|
||||
// Add iOS edge swipe gesture to exit (similar to Android back button)
|
||||
// Supports both touch and trackpad input (iPadOS with external trackpad/Magic Keyboard)
|
||||
if (isIOS) {
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
@@ -213,6 +214,7 @@ class _TerminalPageState extends State<TerminalPage>
|
||||
return GestureDetector(
|
||||
// Use translucent to allow terminal gestures to still work
|
||||
behavior: HitTestBehavior.translucent,
|
||||
// GestureDetector supports all pointer devices by default (touch, mouse, trackpad)
|
||||
onHorizontalDragStart: (details) {
|
||||
_swipeStartX = details.globalPosition.dx;
|
||||
_swipeCurrentX = details.globalPosition.dx; // Reset to start position
|
||||
@@ -222,6 +224,7 @@ class _TerminalPageState extends State<TerminalPage>
|
||||
},
|
||||
onHorizontalDragEnd: (details) {
|
||||
// Check if swipe started from left edge and moved right
|
||||
// Works for both touch swipes and trackpad gestures
|
||||
if (_swipeStartX < edgeThreshold && (_swipeCurrentX - _swipeStartX) > swipeThreshold) {
|
||||
// Trigger exit same as Android back button
|
||||
clientClose(sessionId, _ffi);
|
||||
|
||||
Reference in New Issue
Block a user