Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- allocateCursorPos :: ResourceT (StageRIO st) (MomentIO (Event (Double, Double)))
- allocateDrop :: ResourceT (StageRIO st) (MomentIO (Event [FilePath]))
- allocateMouseButton :: ResourceT (StageRIO st) (MomentIO (Event (ModifierKeys, MouseButtonState, MouseButton)))
- allocateScroll :: ResourceT (StageRIO st) (MomentIO (Event (Double, Double)))
- allocateKey :: ResourceT (StageRIO st) (MomentIO (Event (Int, (ModifierKeys, KeyState, Key))))
- setupScreenBox :: (forall a. StageRIO env a -> MomentIO a) -> MomentIO (Behavior Box)
- setupCursorPos :: MonadMoment m => m (Event (Double, Double)) -> Behavior Box -> m (Event Vec2, Behavior Vec2)
- setupMouseClicks :: MomentIO (Event (ModifierKeys, MouseButtonState, MouseButton)) -> Behavior cursor -> MomentIO (Collection (Event (ModifierKeys, cursor)))
Wrapped Engine.Window.* callbacks
allocateCursorPos :: ResourceT (StageRIO st) (MomentIO (Event (Double, Double))) Source #
Set up a window callback to fire window CursorPos events.
allocateDrop :: ResourceT (StageRIO st) (MomentIO (Event [FilePath])) Source #
Set up a window callback to fire window Drop events.
allocateMouseButton :: ResourceT (StageRIO st) (MomentIO (Event (ModifierKeys, MouseButtonState, MouseButton))) Source #
Set up a window callback to fire window MouseButton events.
To prevent clicks when hovering over some ImGui window wrap in a whenE
filter:
imguiCaptureMouse <- RBF.fromPoll ImGui.wantCaptureMouse mouseButtonE <- fmap (RB.whenE $ fmap not imguiCaptureMouse) fromMouseButton
allocateScroll :: ResourceT (StageRIO st) (MomentIO (Event (Double, Double))) Source #
Set up a window callback to fire window Scroll events.
allocateKey :: ResourceT (StageRIO st) (MomentIO (Event (Int, (ModifierKeys, KeyState, Key)))) Source #
Layout
helpers
setupScreenBox :: (forall a. StageRIO env a -> MomentIO a) -> MomentIO (Behavior Box) Source #
Screen-sized layout base.
setupCursorPos :: MonadMoment m => m (Event (Double, Double)) -> Behavior Box -> m (Event Vec2, Behavior Vec2) Source #
Project window cursor position to layout.
setupMouseClicks :: MomentIO (Event (ModifierKeys, MouseButtonState, MouseButton)) -> Behavior cursor -> MomentIO (Collection (Event (ModifierKeys, cursor))) Source #
Set up a per-button collection of fused (position, modifier) click ("button pressed") events.