helm-1.0.0: A functionally reactive game engine.

Safe HaskellNone
LanguageHaskell2010

Helm.Mouse

Contents

Description

Contains subscriptions to events from the mouse.

Synopsis

Types

data MouseButton Source

Represents a mouse button that can be pressed on a mouse.

Subscriptions

moves Source

Arguments

:: Engine e 
=> (V2 Int -> a)

The function to map a mouse position to an action.

-> Sub e a

The mapped subscription.

Subscribe to mouse movement events and map to a game action.

clicks Source

Arguments

:: Engine e 
=> (MouseButton -> V2 Int -> a)

The function to map a mouse button and position to an action.

-> Sub e a

The mapped subscription.

Subscribe to mouse click events and map to a game action. This subscription is for all mouse buttons - you'll need to match over a mouse button if you want to capture a specific one.

Note that Helm defines a mouse click as a mouse up event which came after a very recent mouse down event in a close radius of the mouse down event.

downs Source

Arguments

:: Engine e 
=> (MouseButton -> V2 Int -> a)

The function to map a mouse button and position to an action.

-> Sub e a

The mapped subscription.

Subscribe to mouse button down events and map to a game action.

ups Source

Arguments

:: Engine e 
=> (MouseButton -> V2 Int -> a)

The function to map a mouse button and position to an action.

-> Sub e a

The mapped subscription.

Subscribe to mouse button up events and map to a game action.