Skip to content

Commit

Permalink
[FreeFlyController] Disable preventDefault on middle mouse button
Browse files Browse the repository at this point in the history
Breaks pointer capture for middle mouse button when
using iframes (e.g. Golden Layout).
  • Loading branch information
hyazinthh committed Feb 4, 2025
1 parent 535a877 commit 429f3b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- Fixed multisampled raw download
- [ArcBallController] Use captured pointer events
- [FreeFlyController] Fix pointer capture for middle mouse button when using iframes

### 5.5.2
- updated Adaptify.Core to 1.3.0 (using local, new style adaptify)
Expand Down
6 changes: 3 additions & 3 deletions src/Aardvark.UI.Primitives/Controllers/FreeFlyController.fs
Original file line number Diff line number Diff line change
Expand Up @@ -610,11 +610,11 @@ module FreeFlyController =
let attributes (state : AdaptiveCameraControllerState) (f : Message -> 'msg) =
AttributeMap.ofListCond [
always (onBlur (fun _ -> f Blur))
always (onCapturedPointerDown (Some 2) (fun t b p -> match t with Mouse -> f (Down(b,p)) | _ -> f Nop))
always (onCapturedPointerUp (Some 2) (fun t b p -> match t with Mouse -> f (Up(b)) | _ -> f Nop))
always (onCapturedPointerDown None (fun t b p -> match t with Mouse -> f (Down(b,p)) | _ -> f Nop))
always (onCapturedPointerUp None (fun t b p -> match t with Mouse -> f (Up(b)) | _ -> f Nop))
onlyWhen
(state.look %|| state.pan %|| state.dolly %|| state.zoom)
(onCapturedPointerMove (Some 2) (fun t p -> match t with Mouse -> f (Move p) | _ -> f Nop ))
(onCapturedPointerMove None (fun t p -> match t with Mouse -> f (Move p) | _ -> f Nop ))
always (onKeyDownModifiers (fun m k -> KeyDown(m,k) |> f))
always (onKeyUpModifiers (fun m k -> KeyUp(m,k) |> f))
always (onWheelPrevent true (fun x -> f (Wheel x)))
Expand Down

0 comments on commit 429f3b4

Please sign in to comment.