Copyright | (c) 2016-19 Brian W Bush |
---|---|
License | MIT |
Maintainer | Brian W Bush <code@functionally.io> |
Stability | Stable |
Portability | Portable |
Safe Haskell | None |
Language | Haskell2010 |
Interaction with Leap Motion <https://www.leapmotion.com/product/desktop>, based on the Web Socket API <https://developer.leapmotion.com/documentation/javascript/supplements/Leap_JSON.html>.
Here is a simple example applicaton that prints all events:
main :: IO () main = runWithHandler def [setFocused True, setGestures True] $ event -> print (event :: Event Float)
- data Configuration = Configuration {}
- data Version = Version {
- serviceVersion :: String
- version :: Int
- setBackground :: Bool -> ConnectionModifier
- setFocused :: Bool -> ConnectionModifier
- setGestures :: Bool -> ConnectionModifier
- setOptimizedHMD :: Bool -> ConnectionModifier
- type ClientApp a = Connection -> IO a
- type Handler a = Event a -> IO ()
- run :: Configuration -> ClientApp a -> IO a
- runWithHandler :: FromJSON a => Configuration -> [ConnectionModifier] -> Handler a -> IO ()
Configuration
data Configuration Source #
Configuration for a connection to a Leap Motion controller via Web Sockets.
Version information for Leap Motion.
Version | |
|
:: Bool | Whether to enable background events. |
-> ConnectionModifier | Function for making the modification. |
Enable or disable background events. See <https://developer.leapmotion.com/documentation/javascript/supplements/Leap_JSON.html> for details.
:: Bool | Whether to enable focus. |
-> ConnectionModifier | Function for making the modification. |
Enable or disable focus. See <https://developer.leapmotion.com/documentation/javascript/supplements/Leap_JSON.html> for details.
:: Bool | Whether to enable gestiure events. |
-> ConnectionModifier | Function for making the modification. |
Enable or disable gestures. See <https://developer.leapmotion.com/documentation/javascript/supplements/Leap_JSON.html> for details.
:: Bool | Whether to enable HMD optimization. |
-> ConnectionModifier | Function for making the modification. |
Enable or disable head-mounted-display optimization. See <https://developer.leapmotion.com/documentation/javascript/supplements/Leap_JSON.html> for details.
Applications
= Connection | The Web Socet connection. |
-> IO a | Action for the client application. |
A client application for Leap Motion using Web Sockets.
A handler for Leap Motion events.
:: Configuration | The Web Socket configuration. |
-> ClientApp a | The client application. |
-> IO a | Action for running the client. |
Run a Leap Motion application using Web Sockets.
:: FromJSON a | |
=> Configuration | The Web Socket configuration. |
-> [ConnectionModifier] | Modifications to be made to the connection. |
-> Handler a | The event handler. |
-> IO () | Action for running with event handling. |
Run and process events from Leap Motion using Web Sockets.